You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ElementTree incorrectly parses strings with declared encoding not UTF-8 #61190
Eli, this issue no longer has open pre-requisites. bpo-10590 was replaced by bpo-17089 which closed now. bpo-17089 fixed Python interface to expat parser, but cElementTree uses C interface of expat directly and the proposed pathes fix it.
Due to the fact that ElementTree's documentation doesn't promise parsing Unicode string perhaps it shouldn't be backported to 2.7. At least I hadn't backported corresponded pyexpat changes (which affects pure Python ElementTree) to 2.7.
Activity
serhiy-storchaka commentedon Jan 17, 2013
serhiy-storchaka commentedon Jan 17, 2013
Patch for bpo-10590 fixes this for Python implementation of ElementTree, but not for C implementation.
serhiy-storchaka commentedon Feb 25, 2013
Here is a patch for C implementation. Python implementation was fixed in bpo-17089.
serhiy-storchaka commentedon Mar 4, 2013
Eli, this issue no longer has open pre-requisites. bpo-10590 was replaced by bpo-17089 which closed now. bpo-17089 fixed Python interface to expat parser, but cElementTree uses C interface of expat directly and the proposed pathes fix it.
serhiy-storchaka commentedon May 22, 2013
Here is an updated patch.
elibendersky commentedon May 22, 2013
LGTM
python-dev commentedon May 22, 2013
New changeset 7781ccae7b9a by Serhiy Storchaka in branch '3.3':
Issue bpo-16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/7781ccae7b9a
New changeset 659c1ce8ed2f by Serhiy Storchaka in branch 'default':
Issue bpo-16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/659c1ce8ed2f
serhiy-storchaka commentedon May 22, 2013
Oh, 2.7 still uses old doctests. It's a challenge to backport tests for this issue.
serhiy-storchaka commentedon May 22, 2013
Due to the fact that ElementTree's documentation doesn't promise parsing Unicode string perhaps it shouldn't be backported to 2.7. At least I hadn't backported corresponded pyexpat changes (which affects pure Python ElementTree) to 2.7.
elibendersky commentedon May 22, 2013
Agreed re 2.7; the problem is not important enough to warrant such a backport, due to the state of maintenance of 2.7 at this point.