[ python-Bugs-1680159 ] Misleading exception from unicode.__contains__
SourceForge.net
noreply at sourceforge.net
Tue Mar 13 21:33:15 CET 2007
Bugs item #1680159, was opened at 2007-03-13 21:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1680159&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jan Hudec (bulbjh)
Assigned to: M.-A. Lemburg (lemburg)
Summary: Misleading exception from unicode.__contains__
Initial Comment:
Hello Folks,
unicode.__contains__ throws:
>>> '\xff' in u'foo'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'in <string>' requires string as left operand
while:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
would be more helpful, because that's what really fails there. The exception it throws now does not indicate that unicode is involved.
(tried this with 2.4.4 and 2.5.0 and happens in both)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1680159&group_id=5470
More information about the Python-bugs-list
mailing list