[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-08-11 Thread Stefan Behnel
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

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-08-10 Thread Eli Bendersky
Changes by Eli Bendersky : -- resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-08-03 Thread Eli Bendersky
Eli Bendersky added the comment: I'm not sure what the issue here is, exactly. Python 2.7 is known for implicit conversions between ascii and unicode, and this appears to be an artifact of your data. Note that Python 2.7 only gets fixes for serious bugs at this point. Can you reproduce this pr

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread Brendan O'Connor
Brendan O'Connor added the comment: By "non-deterministic" I just mean that the conversion happens for some data but not other data. I should try to find examples that causes it to happen. -- ___ Python tracker _

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread R. David Murray
Changes by R. David Murray : -- nosy: +eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread R. David Murray
R. David Murray added the comment: This kind of thing is why python3 exists. Presumably some bit of the elementree code is successfully converting non-ascii into unicode, and then when that is mixed with the result it is returning, you end up with unicode. But that is just a guess; you'll ha

[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

2013-06-19 Thread Brendan O'Connor
New submission from Brendan O'Connor: (This is Python 2.7 so I'm using string vs unicode terminology.) When I use ElementTree.fromstring(), and use the .text field on nodes, the value is usually a string object, but in rare cases it's a unicode object. I'm parsing many XML documents of newspa