[Python-bugs-list] [Bug #132933] list.sort doesn't detect comparision errors

noreply@sourceforge.net noreply@sourceforge.net
Sun, 18 Feb 2001 07:30:59 -0800


Bug #132933, was updated on 2001-Feb-18 03:28
Here is a current snapshot of the bug.

Project: Python
Category: Python Interpreter Core
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: effbot
Assigned to : nobody
Summary: list.sort doesn't detect comparision errors

Details: 2.0 does the right thing:

Python 2.0 (#8, Jan 29 2001, 22:28:01) on win32
>>> a = [u"foo", "bär"]
>>> a.sort()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeError: ASCII decoding error: ordinal not in range(128)

2.1 doesn't:

Python 2.1a2 (#10, Feb 18 2001, 00:16:17) on win32
>>> a = [u"foo", "bär"]
>>> a.sort()
>>> a
UnicodeError: ASCII decoding error: ordinal not in range(128)
>>> a
['b\x84r', u'foo']
>>> a.sort()
>>> a = 10
UnicodeError: ASCII decoding error: ordinal not in range(128)
>>> a.sort()
>>> # hey, what's going on here?
...
UnicodeError: ASCII decoding error: ordinal not in range(128)
>>> quit
'Use Ctrl-Z plus Return to exit.'
(reboot)

Follow-Ups:

Date: 2001-Feb-18 07:30
By: tim_one

Comment:
Under a debug build,

Python 2.1a2 (#10, Feb  8 2001, 22:47:05) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> a = [u"foo", "bär"]
[5219 refs]
>>> a.sort()
XXX undetected error
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeError: ASCII decoding error: ordinal not in range(128)
[5262 refs]
>>>

"XXX undetected error" looks like a good clue.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=132933&group_id=5470