[issue29896] ElementTree.fromstring raises undocumented UnicodeError

2017-03-24 Thread R. David Murray
R. David Murray added the comment: Agreed with Terry. The general policy in Python is that we let errors bubble up unless there is a good reason to do something else with them. And errors that bubble up are not, in general, documented. (In short, Python is not Java :) -- nosy: +r.d

[issue29896] ElementTree.fromstring raises undocumented UnicodeError

2017-03-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I disagree. The docs only sporadically mention specific exceptions for specific functions. UnicodeDecodeError can occur any place bytes are decoded to unicode. I think this should be closed. Builtin exceptions are documented in https://docs.python.org/3/li

[issue29896] ElementTree.fromstring raises undocumented UnicodeError

2017-03-24 Thread Vasiliy Faronov
New submission from Vasiliy Faronov: >>> from xml.etree import ElementTree as ET >>> ET.fromstring(b'<\xC4/>') Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1314, in XML parser.feed(text) UnicodeDecodeError: 'utf-8' codec