[issue24711] Document getpass.getpass behavior on ^C

New submission from Markus Unterwaditzer:
getpass.getpass doesn't enter a newline when the user aborts input with ^C, while input/raw_input does.
This behavior is surprising and can lead to mis-formatting of subsequent output. However, since this behavior exists since 2.7 and applications may have started to rely on it, I'd add a note to the documentation.
---------- assignee: docs@python components: Documentation messages: 247302 nosy: docs@python, untitaker priority: normal severity: normal status: open title: Document getpass.getpass behavior on ^C versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
_______________________________________ Python tracker report@bugs.python.org http://bugs.python.org/issue24711 _______________________________________

Irit Katriel iritkatriel@yahoo.com added the comment:
I don't see a difference between getpass and input in this respect:
---------------- import getpass
try: getpass.getpass('getpass: ') except: pass print('goodbye getpass')
try: input('input: ') except: pass print('goodbye input')
------------------
If I run that script and ^C after each prompt, I get this:
python.bat x.py
Running Release|x64 interpreter... getpass: goodbye getpass input: goodbye input
---------- nosy: +iritkatriel resolution: -> works for me status: open -> pending
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue24711 _______________________________________

Irit Katriel iritkatriel@yahoo.com added the comment:
Works for me on both linux and windows.
---------- stage: -> resolved status: pending -> closed
_______________________________________ Python tracker report@bugs.python.org https://bugs.python.org/issue24711 _______________________________________
participants (2)
-
Irit Katriel
-
Markus Unterwaditzer