mirror of
https://github.com/python/cpython.git
synced 2024-12-01 22:04:04 +08:00
Don't use a file object as system id; try to propagate the file name to
the InputSource.
This commit is contained in:
parent
2aa93efda0
commit
5fece7fc1b
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user