[Bug] Python2.0: Unicode/string.letters inconsistency

Dieter Maurer dieter at handshake.de
Sun Dec 3 16:32:01 EST 2000


I have a problem with a Unicode/string.letters inconsistency:

  During "xslt" processing, a unicode string is passed to
  "urlpath.urlpath". This fails with the famous

     UnicodeError: ASCII decoding error: ordinal not in range(128)

  The reason:
  
    "string.letters" contains not only the ASCII letters but
    all "ISO-8859-1" letters.

    "string.letters" is used in "urlparse" to build
    "scheme_chars" against with the URL characters are
    compared. "scheme_chars" cannot be coerced in a Unicode
    string, as it contains non ASCII characters -> the exception.

In my view, it is inconsistent to disallow default unicode
encoding/decoding for non-ASCII characters but place
non-ASCII characters in such a central place as "string.letters".


Dieter
   




More information about the Python-list mailing list