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
_bz2.vcxproj -rw-r--r-- 14.3 KB
_bz2.vcxproj.filters -rw-r--r-- 1.7 KB
_ctypes.vcxproj -rw-r--r-- 16.5 KB
_ctypes.vcxproj.filters -rw-r--r-- 2.3 KB
_ctypes_test.vcxproj -rw-r--r-- 10.6 KB
_ctypes_test.vcxproj.filters -rw-r--r-- 718 bytes
_decimal.vcxproj -rw-r--r-- 17.6 KB
_decimal.vcxproj.filters -rw-r--r-- 4.3 KB
_elementtree.vcxproj -rw-r--r-- 15.0 KB
_elementtree.vcxproj.filters -rw-r--r-- 2.5 KB
_freeze_importlib.vcxproj -rw-r--r-- 8.4 KB
_freeze_importlib.vcxproj.filters -rw-r--r-- 1.1 KB
_hashlib.vcxproj -rw-r--r-- 14.5 KB
_hashlib.vcxproj.filters -rw-r--r-- 436 bytes
_lzma.vcxproj -rw-r--r-- 14.6 KB
_lzma.vcxproj.filters -rw-r--r-- 435 bytes
_msi.vcxproj -rw-r--r-- 12.3 KB
_msi.vcxproj.filters -rw-r--r-- 423 bytes
_multiprocessing.vcxproj -rw-r--r-- 12.4 KB
_multiprocessing.vcxproj.filters -rw-r--r-- 861 bytes
_overlapped.vcxproj -rw-r--r-- 13.0 KB
_overlapped.vcxproj.filters -rw-r--r-- 434 bytes
_socket.vcxproj -rw-r--r-- 12.3 KB
_socket.vcxproj.filters -rw-r--r-- 702 bytes
_sqlite3.vcxproj -rw-r--r-- 14.6 KB
_sqlite3.vcxproj.filters -rw-r--r-- 2.4 KB
_ssl.vcxproj -rw-r--r-- 14.8 KB
_ssl.vcxproj.filters -rw-r--r-- 428 bytes
_testbuffer.vcxproj -rw-r--r-- 11.4 KB
_testbuffer.vcxproj.filters -rw-r--r-- 435 bytes
_testcapi.vcxproj -rw-r--r-- 11.5 KB
_testcapi.vcxproj.filters -rw-r--r-- 439 bytes
_testembed.vcxproj -rw-r--r-- 7.4 KB
_testembed.vcxproj.filters -rw-r--r-- 947 bytes
_testimportmultiple.vcxproj -rw-r--r-- 11.5 KB
_testimportmultiple.vcxproj.filters -rw-r--r-- 444 bytes
_tkinter.vcxproj -rw-r--r-- 13.9 KB
_tkinter.vcxproj.filters -rw-r--r-- 534 bytes
bdist_wininst.vcxproj -rw-r--r-- 8.6 KB
bdist_wininst.vcxproj.filters -rw-r--r-- 2.2 KB
build.bat -rw-r--r-- 551 bytes
build_env.bat -rw-r--r-- 25 bytes
build_pgo.bat -rw-r--r-- 1.1 KB
build_ssl.bat -rw-r--r-- 253 bytes
build_ssl.py -rw-r--r-- 9.4 KB
build_tkinter.py -rw-r--r-- 2.1 KB
debug.props -rw-r--r-- 956 bytes
env.bat -rw-r--r-- 255 bytes
field3.py -rw-r--r-- 974 bytes
idle.bat -rw-r--r-- 284 bytes
installer.bmp -rw-r--r-- 57.4 KB
kill_python.c -rw-r--r-- 5.5 KB
kill_python.vcxproj -rw-r--r-- 6.1 KB
kill_python.vcxproj.filters -rw-r--r-- 424 bytes
make_buildinfo.c -rw-r--r-- 6.8 KB
make_buildinfo.vcxproj -rw-r--r-- 2.5 KB
make_buildinfo.vcxproj.filters -rw-r--r-- 497 bytes
make_versioninfo.vcxproj -rw-r--r-- 9.3 KB
make_versioninfo.vcxproj.filters -rw-r--r-- 435 bytes
pcbuild.sln -rw-r--r-- 49.7 KB
pginstrument.props -rw-r--r-- 1.6 KB
pgupdate.props -rw-r--r-- 737 bytes
pyd.props -rw-r--r-- 859 bytes
pyd_d.props -rw-r--r-- 1.1 KB
pyexpat.vcxproj -rw-r--r-- 13.9 KB
pyexpat.vcxproj.filters -rw-r--r-- 1.1 KB
pylauncher.vcxproj -rw-r--r-- 15.2 KB
pylauncher.vcxproj.filters -rw-r--r-- 1.2 KB
pyproject.props -rw-r--r-- 4.4 KB
python.vcxproj -rw-r--r-- 17.9 KB
python.vcxproj.filters -rw-r--r-- 822 bytes
python3dll.vcxproj -rw-r--r-- 14.0 KB
python3dll.vcxproj.filters -rw-r--r-- 1.2 KB
pythoncore.vcxproj -rw-r--r-- 39.6 KB
pythoncore.vcxproj.filters -rw-r--r-- 31.0 KB
pythonw.vcxproj -rw-r--r-- 17.1 KB
pythonw.vcxproj.filters -rw-r--r-- 702 bytes
pywlauncher.vcxproj -rw-r--r-- 12.2 KB
pywlauncher.vcxproj.filters -rw-r--r-- 1.2 KB
readme.txt -rw-r--r-- 13.9 KB
release.props -rw-r--r-- 629 bytes
rmpyc.py -rw-r--r-- 598 bytes
rt.bat -rw-r--r-- 1.8 KB
select.vcxproj -rw-r--r-- 13.0 KB
select.vcxproj.filters -rw-r--r-- 436 bytes
sqlite3.props -rw-r--r-- 712 bytes
sqlite3.vcxproj -rw-r--r-- 12.6 KB
sqlite3.vcxproj.filters -rw-r--r-- 804 bytes
ssl.vcxproj -rw-r--r-- 16.6 KB
unicodedata.vcxproj -rw-r--r-- 11.6 KB
unicodedata.vcxproj.filters -rw-r--r-- 810 bytes
vs9to10.py -rw-r--r-- 2.2 KB
vs9to8.py -rw-r--r-- 1.3 KB
winsound.vcxproj -rw-r--r-- 11.8 KB
winsound.vcxproj.filters -rw-r--r-- 500 bytes
x64.props -rw-r--r-- 720 bytes
xxlimited.vcxproj -rw-r--r-- 10.5 KB
xxlimited.vcxproj.filters -rw-r--r-- 433 bytes

readme.txt

back to top