[issue4328] "à" in u"foo" raises a misleading error

R. David Murray report at bugs.python.org
Wed Dec 30 16:33:13 CET 2009

R. David Murray <rdmurray at bitdance.com> added the comment:

Actually, I've already fixed this for 2.7 (issue 1680159) by letting the
UnicodeDecodeError propagate upward.  I don't think making 'f' in u'foo'
an error would be a good idea.

Unless I'm mistaken the py3 behavior is correct.  If someone has a case
where the py3 message or behavior is incorrect they can reopen (or open
a new issue, since the cause is likely to be different if there is a

(Actually, the message you get when you do 'o' in b'foo' is...not
obvious; but as I said I think that's a different issue from this one.)

nosy: +r.david.murray
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> Misleading exception from unicode.__contains__
versions:  -Python 3.2

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list