[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

Stefan Behnel report at bugs.python.org
Sun Sep 1 22:47:03 CEST 2013


Stefan Behnel added the comment:

I can well imagine that the serialiser is broken for this in Py2.x, given that the API accepts byte strings and stores them as such. The fix might be as simple as decoding byte strings in the serialiser before writing them out. Involves a pretty high performance regression, though (and ET's serialiser is known to be rather slow anyway).

Not sure if the current behaviour should be changed in 2.x.

In any case, it's a duplicate of the other ticket, which was *not* fixed for 2.7.

----------

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


More information about the Python-bugs-list mailing list