diff options
Diffstat (limited to 'Lib/xml/sax/saxutils.py')
-rw-r--r-- | Lib/xml/sax/saxutils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index b4fc2da764..c1612ea1ce 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -339,6 +339,8 @@ def prepare_input_source(source, base=""): """This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.""" + if isinstance(source, os.PathLike): + source = os.fspath(source) if isinstance(source, str): source = xmlreader.InputSource(source) elif hasattr(source, "read"): |