mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #22915: SAX parser now supports files opened with file descriptor or
bytes path.
This commit is contained in:
parent
7a6915e17d
commit
fc8e9b0e72
3 changed files with 28 additions and 1 deletions
|
@ -346,7 +346,7 @@ def prepare_input_source(source, base=""):
|
|||
f = source
|
||||
source = xmlreader.InputSource()
|
||||
source.setByteStream(f)
|
||||
if hasattr(f, "name"):
|
||||
if hasattr(f, "name") and isinstance(f.name, str):
|
||||
source.setSystemId(f.name)
|
||||
|
||||
if source.getByteStream() is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue