New submission from Merlijn van Deen <valhall...@gmail.com>: In python 2.5, entering ^C in a getpass prompt yields a KeyboardInterrupt. In later versions, nothing happens, and '\x03' is returned after pressing return. In python 2.5, entering ^Z in a getpass prompt suspends the process. In later versions, nothing happens, and '\x1a' is returned after pressing return.
Pressing ctrl-C or ctrl-Z multiple times returns '\x03'/'\x1a' multiple times. Tested versions: Python 2.5.4 (r254:67916, Jan 20 2010, 21:44:03) [GCC 4.3.3] on linux2 (OK) getpass.py is http://svn.python.org/view/python/trunk/Lib/getpass.py?revision=43495&view=markup Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 (BAD) getpass.py is r76000 with the following diff: 54c54 < except (AttributeError, ValueError): --- > except: (so it doesn't implement r74860) Python 2.7.1 (r271:86832, Jan 4 2011, 13:57:14) [GCC 4.5.2] on sunos5 (BAD) Python 3.1.2 (r312:79147, Sep 27 2010, 09:45:41) [GCC 4.4.3] on linux2 (BAD) Python 3.1.3 (r313:86834, Dec 1 2010, 20:16:39) [GCC 4.5.1] on sunos5 (BAD) Steps to reproduce: 1) import getpass 2) getpass.getpass('-> ') 3) press ctrl-C or ctrl-Z - nothing happens 4) press return - '\x03'/'\x1a' is returned ---------- components: Library (Lib) messages: 128754 nosy: valhallasw priority: normal severity: normal status: open title: getpass.getpass does not respond to ctrl-c or ctrl-z versions: Python 2.6, Python 2.7, Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11236> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com