From: Martin v. Löwis Date: Fri, 6 Oct 2000 21:11:20 +0000 (+0000) Subject: Don't use a file object as system id; try to propagate the file name to X-Git-Tag: v2.0c1~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5fece7fc1be798869cefc71dc9ea7b8a7fd4173c;p=python 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 892f34dc1c..9fe8a4a999 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -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()