classification
Title: readline interferes with characters beginning with byte \xe9
Type: behavior Stage:
Components: Unicode Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: haypo, petri.lehtinen, takluyver
Priority: normal Keywords:

Created on 2011-03-26 00:28 by takluyver, last changed 2011-07-30 10:41 by petri.lehtinen.

Messages (2)
msg132192 - (view) Author: Thomas Kluyver (takluyver) * Date: 2011-03-26 00:28
To replicate, in Python 3.1 on Linux (utf-8 console):

>>> print(chr(0x9000))
退

Copy and paste this character into the prompt. It appears correctly (as a Chinese character). Then:

>>> import readline
>>> readline.parse_and_bind('"\M-i":"    "')

Now try to paste the character again: it appears as "    ��"
 (four spaces, two unknown character symbols), and if you press return, you get a SyntaxError.

This happens with all characters beginning with \xe9: In UTF-8, that's 0x9000-0x9fff. If the terminal encoding is changed to cp1252, I'm told that the same thing can be achieved with é, which is \xe9 there.
msg141435 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-07-30 10:41
You're binding the M-i keyboard sequence. Could it be that the \xe9 byte is translated by the terminal to M-i, and that causes the interference? In this case, it's not really a bug.
History
Date User Action Args
2011-07-30 10:41:45petri.lehtinensetnosy: + petri.lehtinen

messages: + msg141435
versions: + Python 2.7, Python 3.2, Python 3.3, - Python 2.6, Python 3.1
2011-03-26 00:32:55pitrousetnosy: + haypo
2011-03-26 00:28:38takluyvercreate