summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-27 20:14:30 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-27 20:14:30 (GMT)
commit5916d5303273c9b7f8918b0776ea0f7467e7cebd (patch)
treed48ddad1e01439c52d70bb342217257ef8f0b4ad /Lib/xml
parent715f01b56581b58af34e3dd703bf05fc54510628 (diff)
parentfc8e9b0e726c14d10cf33864710364b3cb4ae368 (diff)
downloadcpython-5916d5303273c9b7f8918b0776ea0f7467e7cebd.zip
cpython-5916d5303273c9b7f8918b0776ea0f7467e7cebd.tar.gz
cpython-5916d5303273c9b7f8918b0776ea0f7467e7cebd.tar.bz2
Issue #22915: SAX parser now supports files opened with file descriptor or
bytes path.
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/sax/saxutils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index 74de9b0..1d3d0ec 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -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: