classification
Title: xml.sax.parse won't accept path objects
Type: behavior Stage: patch review
Components: Library (Lib), XML Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: craigh, mcepl, pitrou
Priority: normal Keywords: patch

Created on 2017-10-01 20:51 by craigh, last changed 2019-01-14 18:45 by Tiger-222.

Pull Requests
URL Status Linked Edit
PR 8564 open Tiger-222, 2018-07-30 12:43
Messages (1)
msg303490 - (view) Author: Craig Holmquist (craigh) Date: 2017-10-01 20:51
>>> import xml.sax
>>> import pathlib
[...]
>>> xml.sax.parse(pathlib.Path('path/to/file'), handler)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/xml/sax/__init__.py", line 33, in parse
    parser.parse(source)
  File "/usr/lib/python3.6/xml/sax/expatreader.py", line 105, in parse
    source = saxutils.prepare_input_source(source)
  File "/usr/lib/python3.6/xml/sax/saxutils.py", line 355, in prepare_input_source
    if source.getCharacterStream() is None and source.getByteStream() is None:
AttributeError: 'PosixPath' object has no attribute 'getCharacterStream'
History
Date User Action Args
2019-01-14 18:45:07Tiger-222setversions: + Python 3.7, Python 3.8
2018-07-30 12:43:58Tiger-222setkeywords: + patch
stage: patch review
pull_requests: + pull_request8078
2018-03-05 00:37:50mceplsetnosy: + mcepl
2017-10-01 20:55:11rhettingersetnosy: + pitrou
2017-10-01 20:51:11craighcreate