[issue6233] ElementTree (py3k) doesn't properly encode characters that can't be represented in the specified encoding

Martin v. Löwis report at bugs.python.org
Fri Jun 26 03:12:30 CEST 2009


Martin v. Löwis <martin at v.loewis.de> added the comment:

I disagree with this report being classified as release-critical - it is
*not* a regression over 3.0 (i.e. 3.0 already behaved in the same way).
That it is a regression relative to 2.x should not make it
release-critical - we can still fix such regressions in 3.2.

In addition, there is an easy work-around for applications that run into
the problem - just use utf-8 as the output encoding always:

py> e = ET.XML(b"<?xml version='1.0'
encoding='iso-8859-1'?><body>t\xe3t</body>")
py> ET.tostring(e,encoding='utf-8')
b'<body>t\xc3\xa3t</body>'

----------
nosy: +loewis

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6233>
_______________________________________


More information about the Python-bugs-list mailing list