[Urwid] Problem related to UTF-8 processing of Latin strings (Fatal)
Neil Tallim
red.hamsterx at gmail.com
Sun Apr 16 18:26:13 EDT 2006
I think I've found a problem, and it isn't just a complaint about
Latin strings being mangled if they're evaluated as UTF-8.
Options/modules used for testing:
raw_display
UTF-8 processing
Details:
In urwid/utable.py, lines 88, 98, and 111 ("b2 = ord(text[pos+1])")
will throw an IndexError if one of a few high-ord Latin characters is
at the end of a string. (I think Urwid is expecting another character
to make a UTF-8 pair, but the string being evaluated is plain Latin)
This has been confirmed several times with Latin characters from \xe8
through \xf9 (just arbitrary test values). For my needs, I've just
added a 'try, except IndexError: return error' block around these
lines, but that might not work for everyone.
I've been able to recreate this problem with 0.9.2, so it isn't the
result of a bug introduced with 0.9.3.
-Neil
More information about the Urwid
mailing list