This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: getpass returns garbage when typing tilde on Windows with deadkeys
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.4, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: The Compiler, christian.heimes, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2014-11-10 11:12 by The Compiler, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg230954 - (view) Author: Florian Bruhin (The Compiler) * Date: 2014-11-10 11:12
When using getpass.getpass() on Windows and typing a tilde (~) with a layout with dead keys (e.g. Swiss German), one would typically type "~ " to get a single tilde.

However, this returns '\x00\x83~' with getpass. It seems this is what msvcrt.getch() returns.

Microsofts documentation at http://msdn.microsoft.com/en-us/library/aa297934(v=vs.60).aspx only says "When reading a function key or an arrow key, _getch and _getche must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code." which doesn't really apply to this.

It seems to work fine with other dead keys like ` or ^.

Unless someone knows more about what's happening here I'd suggest replacing '\x00\x83~' by '~' in getpass.
msg230961 - (view) Author: Florian Bruhin (The Compiler) * Date: 2014-11-10 14:06
Maybe this is related: U+0083 is the "no break here" char:

http://www.fileformat.info/info/unicode/char/0083/index.htm
http://en.wikipedia.org/wiki/C0_and_C1_control_codes#C1_set

From wikipedia: "Follows the graphic character that is not to be broken."
History
Date User Action Args
2022-04-11 14:58:10adminsetgithub: 67026
2014-11-10 14:06:02The Compilersetmessages: + msg230961
2014-11-10 11:23:45The Compilersetnosy: + christian.heimes
2014-11-10 11:12:29The Compilercreate