From fc8e9b0e726c14d10cf33864710364b3cb4ae368 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 27 Nov 2014 22:13:16 +0200 Subject: Issue #22915: SAX parser now supports files opened with file descriptor or bytes path. --- Lib/xml/sax/saxutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/xml/sax/saxutils.py') diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 74de9b07fc..1d3d0ecc5f 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: -- cgit v1.2.1