Message74131
| Author |
vstinner |
| Recipients |
vstinner |
| Date |
2008年10月01日.15:37:53 |
| SpamBayes Score |
1.5405908e-09 |
| Marked as misclassified |
No |
| Message-id |
<1222875475.18.0.22602254781.issue4008@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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
__call__
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
decode
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
DISPLAY=$DISPLAY HOME=$HOME xterm". |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2008年10月01日 15:37:55 | vstinner | set | recipients:
+ vstinner |
| 2008年10月01日 15:37:55 | vstinner | set | messageid: <1222875475.18.0.22602254781.issue4008@psf.upfronthosting.co.za> |
| 2008年10月01日 15:37:54 | vstinner | link | issue4008 messages |
| 2008年10月01日 15:37:53 | vstinner | create |
|