Don't use a file object as system id; try to propagate the file name to

the InputSource.
This commit is contained in:
Martin v. Löwis 2000-10-06 21:11:20 +00:00
parent 2aa93efda0
commit 5fece7fc1b

View File

@ -203,8 +203,10 @@ def prepare_input_source(source, base = ""):
source = xmlreader.InputSource(source) source = xmlreader.InputSource(source)
elif hasattr(source, "read"): elif hasattr(source, "read"):
f = source f = source
source = xmlreader.InputSource(source) source = xmlreader.InputSource()
source.setByteStream(f) source.setByteStream(f)
if hasattr(f, "name"):
f.setSystemId(f.name)
if source.getByteStream() is None: if source.getByteStream() is None:
sysid = source.getSystemId() sysid = source.getSystemId()