commit | fc8e9b0e726c14d10cf33864710364b3cb4ae368 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Thu Nov 27 22:13:16 2014 +0200 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Thu Nov 27 22:13:16 2014 +0200 |
tree | 0bfb71556470c4bdbbc4e40b8b1555c189ab6727 | |
parent | 7a6915e17d1ea9d740c23772160c18fdd5a5395f [diff] [blame] |
Issue #22915: SAX parser now supports files opened with file descriptor or bytes path.
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 @@ 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: