【发布时间】:2012-07-08 21:12:45
【问题描述】:
python 3.x
>>> a = input()
hope
>>> a
'hope'
>>> b = input()
håpe
>>> b
'håpe'
>>> c = input()
start typing hå... delete using backspace... and change to hope
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 1: invalid continuation byte
>>>
情况并不可怕,我正在解决它,但奇怪的是,删除时,字节被弄乱了。有其他人经历过吗?
终端历史显示它以为我输入了h?ope
有什么想法吗?
在使用它的脚本中,我确实导入了readline 以提供命令行历史记录。
【问题讨论】:
-
听起来终端坏了,是什么终端?
-
标准版,6-7岁的macbook,10.6.8,虽然我在跑遮阳板。
-
readline可以cause the Mac terminal to crash。再想一想,问题在于 Mac 终端可能会崩溃,所以仍然是 Mac 问题。