We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = 'https://github.com/serhiy-storchaka' closed_at = <Date 2017-08-30.05:15:12.619> created_at = <Date 2017-08-29.17:45:53.331> labels = ['expert-XML', 'type-bug', '3.7'] title = 'xml.etree.ElementTree fails to parse a document (regression)' updated_at = <Date 2017-08-30.05:15:12.566> user = 'https://bugs.python.org/VyacheslavRafalskiy'
bugs.python.org fields:
activity = <Date 2017-08-30.05:15:12.566> actor = 'serhiy.storchaka' assignee = 'serhiy.storchaka' closed = True closed_date = <Date 2017-08-30.05:15:12.619> closer = 'serhiy.storchaka' components = ['XML'] creation = <Date 2017-08-29.17:45:53.331> creator = 'Vyacheslav.Rafalskiy' dependencies = [] files = ['47108', '47109'] hgrepos = [] issue_num = 31303 keywords = [] message_count = 3.0 messages = ['300996', '300997', '301010'] nosy_count = 3.0 nosy_names = ['vstinner', 'serhiy.storchaka', 'Vyacheslav.Rafalskiy'] pr_nums = [] priority = 'critical' resolution = 'duplicate' stage = 'resolved' status = 'closed' superseder = '31170' type = 'behavior' url = 'https://bugs.python.org/issue31303' versions = ['Python 3.6', 'Python 3.7']
The text was updated successfully, but these errors were encountered:
In Python 3.5.4 and 3.6.2, both on Windows and Linux, parsing a manifestly correct xml file like:
xml.etree.ElementTree.parse('bad_file.xml')
raises: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 1023: invalid continuation byte
Any other Python version I tried works fine, including 2.7.13, 3.5.2 ...
Sorry, something went wrong.
Simpler reproducer:
>>> import xml.etree.ElementTree >>> xml.etree.ElementTree.XML(b'<key attr="' + b'x'*1023 + b'\xc3\xa0""/>') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", line 1315, in XML parser.feed(text) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 1023: invalid continuation byte
Seems this is a regression in the Expat library.
This is a duplicate of bpo-31170. Updating expat to 2.2.4 fixes this issue.
serhiy-storchaka
No branches or pull requests
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: