[issue9692] UnicodeDecodeError in ElementTree.tostring()

Ulrich Seidl report at bugs.python.org
Thu Aug 26 16:42:56 CEST 2010


New submission from Ulrich Seidl <Ulrich.Seidl at muneda.com>:

The following code leads to an UnicodeError in python 2.7 while it works fine in 2.6 & 2.5:

# -*- coding: latin-1 -*-
import xml.etree.cElementTree as ElementTree

oDoc = ElementTree.fromstring(
    '<?xml version="1.0" encoding="iso-8859-1"?><ROOT/>' )
oDoc.set( "ATTR", "ÄÖÜ" )
print ElementTree.tostring( oDoc , encoding="iso-8859-1" )

----------
components: XML
messages: 114980
nosy: uis
priority: normal
severity: normal
status: open
title: UnicodeDecodeError in ElementTree.tostring()
versions: Python 2.7

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


More information about the Python-bugs-list mailing list