summaryrefslogtreecommitdiff
path: root/Lib/xml/sax/saxutils.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2000-10-06 21:11:20 +0000
committerMartin v. Löwis <martin@v.loewis.de>2000-10-06 21:11:20 +0000
commit5fece7fc1be798869cefc71dc9ea7b8a7fd4173c (patch)
tree7cc26946ebfa4f0ee985b946b30d32fc18253f7f /Lib/xml/sax/saxutils.py
parent2aa93efda0d2b99a48c14cd777e523934bf51aa8 (diff)
downloadcpython-git-5fece7fc1be798869cefc71dc9ea7b8a7fd4173c.tar.gz
Don't use a file object as system id; try to propagate the file name to
the InputSource.
Diffstat (limited to 'Lib/xml/sax/saxutils.py')
-rw-r--r--Lib/xml/sax/saxutils.py4
1 files changed, 3 insertions, 1 deletions
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()