[Zope3-dev] i18n, unicode, and the underline

Guido van Rossum guido@python.org
Mon, 14 Apr 2003 11:59:57 -0400


> I'll look into this.  First problem I ran into:
> 
> [guido@odiug zope3]$ python2.2 -U test.py
> Traceback (most recent call last):
>   File "test.py", line 143, in ?
>     import re
> ImportError: No module named re
> [guido@odiug zope3]$ 
> 
> This does not bode well. :-(

Python 2.3 works better, but there are too many places where Unicode
isn't accepted even if it contains only ASCII.  Two common cases:

(1) In Python itself, names of things are often required to have 'str'
    as their type, for example class names, attribute names, keyword
    argument names.  When the name is given by the code as a string
    literal, this fails.

(2) I found a lot of schema code that requires 'str' as the type in
    some validate() method, where a default was given as an 8-bit
    string literal.

I fixed at least a dozen of these by putting str() around the string
literal, but the stream of problems doesn't seem to stop, so I
conclude this is not a good use of my time. :-)

BTW I misremembered that Python's unit tests "mostly pass" with -U.
They "mostly fail". :-(

--Guido van Rossum (home page: http://www.python.org/~guido/)