mirror of
https://github.com/python/cpython.git
synced 2024-12-02 06:14:49 +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)
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user