Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

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

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 3, 2013, 6:00 PM

Post #1 of 3 (23 views)
Permalink
[issue18268] ElementTree.fromstring non-deterministically gives unicode text data

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 problem with Python 3.3? More generally, can you provide a small reproducer? Without this I don't think this is a constructive report, and will close the issue in a few days.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue18268>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 10, 2013, 5:55 AM

Post #2 of 3 (12 views)
Permalink
[issue18268] ElementTree.fromstring non-deterministically gives unicode text data [In reply to]

Changes by Eli Bendersky <eliben [at] gmail>:


----------
resolution: -> invalid
stage: -> committed/rejected
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue18268>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 11, 2013, 9:12 AM

Post #3 of 3 (11 views)
Permalink
[issue18268] ElementTree.fromstring non-deterministically gives unicode text data [In reply to]

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 <report [at] bugs>
<http://bugs.python.org/issue18268>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.