python input UnicodeDecodeError:
- by The man on the Clapham omnibus
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
>>>
The situation is not terrible, I am working around it, but find it strange that when deleting, the bytes get messed up. Has anyone else experienced this?
the terminal history shows that I thought that I entered h?ope
any ideas?
in the script that is using this, I do import readline to give command line history.