New submission from Peter Cai <newpt...@gmail.com>: xml.etree.ElementTree.fromstring doesn't work with Unicode string. See the code below:
>>> from xml.etree import ElementTree >>> t = ElementTree.fromstring(u'<doc>诗</doc>') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Python26\lib\xml\etree\ElementTree.py", line 963, in XML parser.feed(text) File "D:\Python26\lib\xml\etree\ElementTree.py", line 1245, in feed self._parser.Parse(data, 0) UnicodeEncodeError: 'ascii' codec can't encode character u'\u8bd7' in position 5 : ordinal not in range(128) ---------- components: XML messages: 127239 nosy: Peter.Cai priority: normal severity: normal status: open title: ElementTree.fromstring doesn't work with Unicode type: crash versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11033> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com