Staging
v0.5.1
https://github.com/python/cpython
Revision 1058cda38f1b409c4d52eef236f4915df592a112 authored by R David Murray on 29 March 2015, 19:15:40 UTC, committed by R David Murray on 29 March 2015, 19:15:40 UTC
Previously, if you hit ctl-c while the pager was active, the python that
launched the subprocess for the pager would see the KeyboardInterrupt in the
__exit__ method of the subprocess context manager where it was waiting for the
subprocess to complete, ending the wait.  This would leave the pager running,
while the interactive interpreter, after handling the exception by printing
it, would go back to trying to post a prompt...but the pager would generally
have the terminal in raw mode, and in any case would be still trying to read
from stdin.  On some systems, even exiting python at that point would not
restore the terminal mode.  The problem with raw mode could also happen if
ctl-C was hit when pydoc was called from the shell command line and the pager
was active.

Instead, we now wait on the subprocess in a loop, ignoring KeyboardInterrupt
just like the pager does, until the pager actually exits.

(Note: this was a regression relative to python2...in python2 the pager
is called via system, and system does not return until the pager exits.)
1 parent 48070c1
History
Tip revision: 1058cda38f1b409c4d52eef236f4915df592a112 authored by R David Murray on 29 March 2015, 19:15:40 UTC
#23792: Ignore KeyboardInterrupt when the pydoc pager is active.
Tip revision: 1058cda
File Mode Size
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
Tools
.bzrignore -rw-r--r-- 584 bytes
.gitignore -rw-r--r-- 971 bytes
.hgeol -rw-r--r-- 800 bytes
.hgignore -rw-r--r-- 1.3 KB
.hgtags -rw-r--r-- 7.0 KB
.hgtouch -rw-r--r-- 1.2 KB
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 54.1 KB
README -rw-r--r-- 6.6 KB
config.guess -rwxr-xr-x 41.9 KB
config.sub -rwxr-xr-x 34.9 KB
configure -rwxr-xr-x 440.4 KB
configure.ac -rw-r--r-- 138.8 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 40.2 KB
setup.py -rw-r--r-- 95.2 KB

README

back to top