[New-bugs-announce] [issue4008] IDLE: checksyntax() doesn't support Unicode?

STINNER Victor report at bugs.python.org
Wed Oct 1 17:37:55 CEST 2008

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

IDLE checksyntax() function doesn't support Unicode. Example with 
idle-3.0rc1-quits-when-run.py in an ASCII terminal:

$ ./python Tools/scripts/idle
Exception in Tkinter callback
Traceback (most recent call last):
  File "/home/haypo/prog/py3k/Lib/tkinter/__init__.py", line 1405, in 
    return self.func(*args)
  File "/home/haypo/prog/py3k/Lib/idlelib/ScriptBinding.py", line 124, 
in run_module_event
    code = self.checksyntax(filename)
  File "/home/haypo/prog/py3k/Lib/idlelib/ScriptBinding.py", line 86, 
in checksyntax
    source = f.read()
  File "/home/haypo/prog/py3k/Lib/io.py", line 1719, in read
    decoder.decode(self.buffer.read(), final=True))
  File "/home/haypo/prog/py3k/Lib/io.py", line 1294, in decode
    output = self.decoder.decode(input, final=final)
  File "/home/haypo/prog/py3k/Lib/encodings/ascii.py", line 26, in 
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 
87: ordinal not in range(128)

To open an ASCII terminal on Linux, you can for example use xterm with 
an empty environment (except DISPLAY and HOME variables): "env -i 

components: IDLE
files: idle-3.0rc1-quits-when-run.py
messages: 74131
nosy: haypo
severity: normal
status: open
title: IDLE: checksyntax() doesn't support Unicode?
versions: Python 3.0
Added file: http://bugs.python.org/file11672/idle-3.0rc1-quits-when-run.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list