[New-bugs-announce] [issue1688] Incorrectly displayed non ascii characters in prompt using "input()" - Python 3.0a2

Vlastimil Brom report at bugs.python.org
Sat Dec 22 22:09:33 CET 2007


New submission from Vlastimil Brom:

While testing the 3.0a2 build (on Win XPh SP2, Czech), I found a 
possible bug in the input() function; 
if the prompt text contains non-ascii characters (even those present in 
the default charset of the system locale - Czech in this case) the 
prompt is displayed incorrectly; however, the inserted value is treated 
as expected.

The print() function deals with these characters correctly. 
This bug occurs in the system console (cmd.exe) only, using idle 
everything works ok.


============ a minimal snapshot of the session follows ==========

Python 3.0a2 (r30a2:59397:59399, Dec  6 2007, 22:34:52) [MSC v.1500 32 
bit (Inte
l)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> input("ěšč: ")
─Ť┼í─Ź: 7
'7'
>>> print("ěšč: ")
ěšč:
>>>

==================================


Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit 
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> input(u"ěšč: ")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-
2: ordin
al not in range(128)
>>> print u"ěšč: "
ěšč:
>>>

----------
components: Unicode, Windows
messages: 58965
nosy: vbr
severity: normal
status: open
title: Incorrectly displayed non ascii characters in prompt using "input()" - Python 3.0a2
versions: Python 3.0

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1688>
__________________________________


More information about the New-bugs-announce mailing list