From 5fece7fc1be798869cefc71dc9ea7b8a7fd4173c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 6 Oct 2000 21:11:20 +0000 Subject: [PATCH] Don't use a file object as system id; try to propagate the file name to the InputSource. --- Lib/xml/sax/saxutils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 892f34dc1cb..9fe8a4a9992 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()