]> granicus.if.org Git - python/commitdiff
Don't use a file object as system id; try to propagate the file name to
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 6 Oct 2000 21:11:20 +0000 (21:11 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 6 Oct 2000 21:11:20 +0000 (21:11 +0000)
the InputSource.

Lib/xml/sax/saxutils.py

index 892f34dc1cb1db4494c13b61104922da62438096..9fe8a4a9992dc19092881936bebddcae4152e959 100644 (file)
@@ -203,8 +203,10 @@ def prepare_input_source(source, base = ""):
         source = xmlreader.InputSource(source)
     elif hasattr(source, "read"):
         f = source
-        source = xmlreader.InputSource(source)
+        source = xmlreader.InputSource()
         source.setByteStream(f)
+        if hasattr(f, "name"):
+            f.setSystemId(f.name)
 
     if source.getByteStream() is None:
         sysid = source.getSystemId()