#56 Unicode handling in the "Add" dialog

Severe bug
closed-fixed
interface (14)
5
2004-06-08
2004-05-31
Aurelien Bompard
No

When I add characters outside the latin-1 range,
pybliographic's add window seem to freeze. In the
console output, I get a traceback with "NameError:
global name 'UnicodeEncodeError' is not defined"

The name of the exception for Unicode errors is
"UnicodeError", not "UnicodeEncodeError", for python >=
2.3 :
-------
>>> str(u"יאח")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
UnicodeError: ASCII encoding error: ordinal not in
range(128)
-------

Changing the two occurences of UnicodeEncodeError into
UnicodeError in Pyblio/GnomeUI/Editor.py fixed the
problem: a window pops up to tell me the mistake, and
the interface is not frozen. A quick grep in the
sources shows no other occurences of
UnicodeEncodeError, so I think that's all for this bug.

On this page:
http://www.python.org/doc/current/lib/module-exceptions.html
one can read:
exception UnicodeEncodeError
Raised when a Unicode-related error occurs during
encoding. It is a subclass of UnicodeError. New in
version 2.3.

Please change UnicodeEncodeError into UnicodeError to
be compatible with python <= 2.3

Discussion

    • assigned_to: nobody --> gobry
     
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=27260

    Thanks for the report. Fixed in arch, patch-111