[issue24711] Document getpass.getpass behavior on ^C

2022-01-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In IDLE Shell, with either ^C or ^D,

>> try:
... input('??')
... except:
... 'done'
... 
... 
??
'done'

'getpass.getpass('??') does same after printing warning from line 100 that 
fallback_getpass is being used.  The newline may be supplied by IDLE, not sure.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2022-01-17 Thread David Lord


David Lord  added the comment:

Meant to say that "done" shows up on the same line, not the shell prompt. An 
earlier version of my example was in the REPL, where its prompt *does* show up 
on the same line.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2022-01-17 Thread Irit Katriel


Change by Irit Katriel :


--
resolution: works for me -> 
versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.2, Python 3.3, Python 
3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2022-01-17 Thread Irit Katriel


Change by Irit Katriel :


--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2022-01-17 Thread David Lord


David Lord  added the comment:

I can reproduce this on Python 3.10. 
Actually, `input` and `getpass` both seem to have this behavior now. Please 
reopen it.

```python
import getpass

try:
getpass.getpass("in: ")
except:
pass

print("done")
```

```
$ python example.py
getpass: ^D done
$
```

Run this and press `Ctrl+D` or `Ctrl+C`. The shell prompt appears on the same 
line rather than the next line.

--
nosy: +davidism

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2021-01-11 Thread Irit Katriel


Irit Katriel  added the comment:

Works for me on both linux and windows.

--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2020-12-04 Thread Irit Katriel


Irit Katriel  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24711] Document getpass.getpass behavior on ^C

2015-07-24 Thread Markus Unterwaditzer

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 rep...@bugs.python.org
http://bugs.python.org/issue24711
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com