[Python-bugs-list] [ python-Bugs-513666 ] unicode() docs don't mention LookupError

noreply@sourceforge.net noreply@sourceforge.net
Wed, 06 Feb 2002 00:52:49 -0800


Bugs item #513666, was opened at 2002-02-06 00:52
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=513666&group_id=5470

Category: Documentation
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Ben Gertzfield (che_fox)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: unicode() docs don't mention LookupError

Initial Comment:
The unicode() docs say:

"If errors is 'strict' (the default), a ValueError is
raised on errors..."

This is not true; ValueError is only raised on
conversion errors.  There are other exceptions that can
be raised:

Python 2.1.2 (#1, Jan 18 2002, 18:05:45) 
[GCC 2.95.4  (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more
information.

>>> unicode("abc", "nonexistent codec")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
LookupError: unknown encoding

Looking at src/Objects/unicodeobject.c, there are lots
of other exceptions that can be raised.  The
documentation should probably be clarified.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=513666&group_id=5470