[issue13360] UnicodeWarning raised on dict() and set()

Florent Xicluna report at bugs.python.org
Sun Nov 6 21:46:08 CET 2011


Florent Xicluna <florent.xicluna at gmail.com> added the comment:

Similar expressions where the warning is raised or not (depending on "latin-1" comparison):


$ python2.7 -c "print u'd\xe9' in {'foo', 'd\xe9r'}"
False
$ python2.7 -c "print u'd\xe9' in {'foo', 'd\xe9'}"
-c:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
False


$ python2.7 -c "print 'd\xe9r' in {u'foo', u'd\xe9'}"
False
$ python2.7 -c "print 'd\xe9'  in {u'foo', u'd\xe9'}"
-c:1: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
False

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13360>
_______________________________________


More information about the Python-bugs-list mailing list