Don't use a file object as system id; try to propagate the file name to
the InputSource.
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index 892f34d..9fe8a4a 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -203,8 +203,10 @@
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()