Re: Bug#613086: New test, new situation
Jason White <jason@jasonjgw.net> writes:
> Jean-Philippe MENGUAL <mengualjeanphi@free.fr> wrote:
>> File "/usr/lib/pymodules/python2.6/orca/braille.py", line 356, in __init__
>> self.rawLine = string.decode("UTF-8").strip("\n")
>> File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
>> return codecs.utf_8_decode(input, errors, True)
>> UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 10: invalid continuation byte
>>
>> generate braille results:
>> BRAILLE LINE: ''
>> VISIBLE: '', cursor=0
>
> Are you using a UTF-8 language setting?
Looking at the backtrace and remembering my rusty python,
I think $LANG should be irrelevant here.
It looks like Python is trying to decode an UTF-8
string and fails because the string is encoded invalid.
Maybe Orca is just missing a try/catch block to correctly catch utf-8
decode errors?
The error happens at src/orca/braille.py:356 (relative to orca source
directory).
The code looks something like:
# The uncontracted string for the line.
#
self.rawLine = string.decode("UTF-8").strip("\n")
Maybe something like:
# The uncontracted string for the line.
#
try:
self.rawLine = string.decode("UTF-8").strip("\n")
except UnicodeDecodeError:
pass
Could "fix" this problem.
It would be interesting to see the actual string which fails though.
So its probably more useful to change the except-block
to something which prints the string in question to the debug log.
--
CYa,
⡍⠁⠗⠊⠕
Reply to: