summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2000-10-06 21:11:20 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2000-10-06 21:11:20 (GMT)
commit5fece7fc1be798869cefc71dc9ea7b8a7fd4173c (patch)
tree7cc26946ebfa4f0ee985b946b30d32fc18253f7f /Lib/xml/sax
parent2aa93efda0d2b99a48c14cd777e523934bf51aa8 (diff)
downloadcpython-5fece7fc1be798869cefc71dc9ea7b8a7fd4173c.zip
cpython-5fece7fc1be798869cefc71dc9ea7b8a7fd4173c.tar.gz
cpython-5fece7fc1be798869cefc71dc9ea7b8a7fd4173c.tar.bz2
Don't use a file object as system id; try to propagate the file name to
the InputSource.
Diffstat (limited to 'Lib/xml/sax')
-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 892f34d..9fe8a4a 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()