This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients Brendan.OConnor, eli.bendersky, r.david.murray, scoder
Date 2013-08-11.16:12:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376237536.78.0.746438710797.issue18268@psf.upfronthosting.co.za>
In-reply-to
Content
Rejecting this ticket was the right thing to do. It's not a bug but a feature. In Python 2.x, ElementTree returns any text content that can correctly be represented as an ASCII encoded string in the native Py2.x string type (i.e. 'str'). Only non-ASCII strings are returned as unicode values. So it's actually completely deterministic and predictable behaviour. Amongst other things, it saves memory.

Note that in Python 2.x, ASCII-only str values are compatible with unicode values and get promoted to unicode at need. If you want to make sure you always use unicode values, you can call "unicode(text)" on whatever you get back, but in practice, it's really not a problem.
History
Date User Action Args
2013-08-11 16:12:16scodersetrecipients: + scoder, r.david.murray, eli.bendersky, Brendan.OConnor
2013-08-11 16:12:16scodersetmessageid: <1376237536.78.0.746438710797.issue18268@psf.upfronthosting.co.za>
2013-08-11 16:12:16scoderlinkissue18268 messages
2013-08-11 16:12:16scodercreate