Stefan Behnel added the comment: 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. ---------- nosy: +scoder _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18268> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com