[Urwid] Problem with ö in Input-Widgets.

Ian Ward ian at excess.org
Tue Dec 30 10:08:51 EST 2008


Christian Scharkus wrote:
> Hi.
> 
> As I written in former mails I'm currently writing a Chat Client with 
> urwid and sometimes then I type some unicode character like ö, ä, ü or ß 
> urwid crashes with following traceback:
> 
> Traceback:
> 
> File "/home/arch/keckz/trunk/controllerKeckz.py", line 242, in ownprivMsg
> self.view.printMsg(nick,msg,"",3)
> File "/home/arch/keckz/trunk/cliView.py", line 130, in printMsg
> self.lookupRooms[room].addLine(msg)
> File "/home/arch/keckz/trunk/cliView.py", line 255, in addLine
> self.Output.append(urwid.Text(text))
> File "/usr/lib/python2.6/site-packages/urwid/widget.py", line 443, in 
> __init__
> self.set_text(markup)
> File "/usr/lib/python2.6/site-packages/urwid/widget.py", line 477, in 
> set_text
> self._text, self._attrib = decompose_tagmarkup(markup)
> File "/usr/lib/python2.6/site-packages/urwid/util.py", line 368, in 
> decompose_tagmarkup
> text = "".join(tl)
> 
> exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in 
> position 1: ordinal not in range(128)

the "text" parameter at cliView line 255 likely contains both unicode 
and plain strings.  Try using only unicode strings or plain strings in 
UTF-8 in that parameter.

Ian




More information about the Urwid mailing list