Staging
v0.8.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
asyncio
collections
concurrent
ctypes
curses
dbm
distutils
email
encodings
ensurepip
html
http
idlelib
importlib
json
lib2to3
logging
msilib
multiprocessing
plat-aix4
plat-darwin
plat-freebsd4
plat-freebsd5
plat-freebsd6
plat-freebsd7
plat-freebsd8
plat-generic
plat-linux
plat-netbsd1
plat-next3
plat-sunos5
plat-unixware7
pydoc_data
site-packages
sqlite3
test
tkinter
turtledemo
unittest
urllib
venv
wsgiref
xml
xmlrpc
__future__.py -rw-r--r-- 4.5 KB
__phello__.foo.py -rw-r--r-- 64 bytes
_bootlocale.py -rw-r--r-- 1.3 KB
_collections_abc.py -rw-r--r-- 19.4 KB
_compat_pickle.py -rw-r--r-- 4.2 KB
_dummy_thread.py -rw-r--r-- 4.8 KB
_markupbase.py -rw-r--r-- 14.3 KB
_osx_support.py -rw-r--r-- 18.7 KB
_pyio.py -rw-r--r-- 72.0 KB
_sitebuiltins.py -rw-r--r-- 3.0 KB
_strptime.py -rw-r--r-- 21.2 KB
_threading_local.py -rw-r--r-- 7.2 KB
_weakrefset.py -rw-r--r-- 5.6 KB
abc.py -rw-r--r-- 8.4 KB
aifc.py -rw-r--r-- 30.8 KB
antigravity.py -rw-r--r-- 475 bytes
argparse.py -rw-r--r-- 87.9 KB
ast.py -rw-r--r-- 11.8 KB
asynchat.py -rw-r--r-- 11.5 KB
asyncore.py -rw-r--r-- 20.5 KB
base64.py -rwxr-xr-x 19.7 KB
bdb.py -rw-r--r-- 22.8 KB
binhex.py -rw-r--r-- 13.4 KB
bisect.py -rw-r--r-- 2.5 KB
bz2.py -rw-r--r-- 18.4 KB
cProfile.py -rwxr-xr-x 5.2 KB
calendar.py -rw-r--r-- 22.4 KB
cgi.py -rwxr-xr-x 34.8 KB
cgitb.py -rw-r--r-- 11.8 KB
chunk.py -rw-r--r-- 5.3 KB
cmd.py -rw-r--r-- 14.5 KB
code.py -rw-r--r-- 9.8 KB
codecs.py -rw-r--r-- 35.1 KB
codeop.py -rw-r--r-- 5.9 KB
colorsys.py -rw-r--r-- 4.0 KB
compileall.py -rw-r--r-- 9.6 KB
configparser.py -rw-r--r-- 48.3 KB
contextlib.py -rw-r--r-- 11.4 KB
copy.py -rw-r--r-- 8.8 KB
copyreg.py -rw-r--r-- 6.7 KB
crypt.py -rw-r--r-- 1.8 KB
csv.py -rw-r--r-- 15.8 KB
datetime.py -rw-r--r-- 74.4 KB
decimal.py -rw-r--r-- 223.3 KB
difflib.py -rw-r--r-- 79.8 KB
dis.py -rw-r--r-- 16.8 KB
doctest.py -rw-r--r-- 102.0 KB
dummy_threading.py -rw-r--r-- 2.7 KB
enum.py -rw-r--r-- 20.9 KB
filecmp.py -rw-r--r-- 9.6 KB
fileinput.py -rw-r--r-- 14.2 KB
fnmatch.py -rw-r--r-- 3.1 KB
formatter.py -rw-r--r-- 14.8 KB
fractions.py -rw-r--r-- 22.7 KB
ftplib.py -rw-r--r-- 37.4 KB
functools.py -rw-r--r-- 27.8 KB
genericpath.py -rw-r--r-- 3.8 KB
getopt.py -rw-r--r-- 7.3 KB
getpass.py -rw-r--r-- 5.9 KB
gettext.py -rw-r--r-- 17.2 KB
glob.py -rw-r--r-- 3.4 KB
gzip.py -rw-r--r-- 23.7 KB
hashlib.py -rw-r--r-- 7.8 KB
heapq.py -rw-r--r-- 17.6 KB
hmac.py -rw-r--r-- 4.9 KB
imaplib.py -rw-r--r-- 49.1 KB
imghdr.py -rw-r--r-- 3.4 KB
imp.py -rw-r--r-- 9.8 KB
inspect.py -rw-r--r-- 101.9 KB
io.py -rw-r--r-- 3.3 KB
ipaddress.py -rw-r--r-- 69.9 KB
keyword.py -rwxr-xr-x 2.2 KB
linecache.py -rw-r--r-- 3.8 KB
locale.py -rw-r--r-- 72.8 KB
lzma.py -rw-r--r-- 18.9 KB
macpath.py -rw-r--r-- 5.5 KB
macurl2path.py -rw-r--r-- 2.7 KB
mailbox.py -rw-r--r-- 76.5 KB
mailcap.py -rw-r--r-- 7.3 KB
mimetypes.py -rw-r--r-- 20.3 KB
modulefinder.py -rw-r--r-- 22.9 KB
netrc.py -rw-r--r-- 5.6 KB
nntplib.py -rw-r--r-- 42.1 KB
ntpath.py -rw-r--r-- 20.0 KB
nturl2path.py -rw-r--r-- 2.3 KB
numbers.py -rw-r--r-- 10.0 KB
opcode.py -rw-r--r-- 5.3 KB
operator.py -rw-r--r-- 9.0 KB
optparse.py -rw-r--r-- 58.9 KB
os.py -rw-r--r-- 33.0 KB
pathlib.py -rw-r--r-- 41.1 KB
pdb.py -rwxr-xr-x 59.5 KB
pickle.py -rw-r--r-- 54.5 KB
pickletools.py -rw-r--r-- 89.6 KB
pipes.py -rw-r--r-- 8.7 KB
pkgutil.py -rw-r--r-- 20.7 KB
platform.py -rwxr-xr-x 47.9 KB
plistlib.py -rw-r--r-- 30.7 KB
poplib.py -rw-r--r-- 13.9 KB
posixpath.py -rw-r--r-- 13.1 KB
pprint.py -rw-r--r-- 14.6 KB
profile.py -rwxr-xr-x 21.5 KB
pstats.py -rw-r--r-- 25.7 KB
pty.py -rw-r--r-- 4.7 KB
py_compile.py -rw-r--r-- 6.9 KB
pyclbr.py -rw-r--r-- 13.2 KB
pydoc.py -rwxr-xr-x 100.3 KB
queue.py -rw-r--r-- 8.6 KB
quopri.py -rwxr-xr-x 7.1 KB
random.py -rw-r--r-- 25.5 KB
re.py -rw-r--r-- 15.2 KB
reprlib.py -rw-r--r-- 5.0 KB
rlcompleter.py -rw-r--r-- 5.6 KB
runpy.py -rw-r--r-- 10.6 KB
sched.py -rw-r--r-- 6.2 KB
selectors.py -rw-r--r-- 16.3 KB
shelve.py -rw-r--r-- 8.2 KB
shlex.py -rw-r--r-- 11.3 KB
shutil.py -rw-r--r-- 38.3 KB
site.py -rw-r--r-- 20.7 KB
smtpd.py -rwxr-xr-x 29.5 KB
smtplib.py -rwxr-xr-x 37.8 KB
sndhdr.py -rw-r--r-- 6.1 KB
socket.py -rw-r--r-- 18.4 KB
socketserver.py -rw-r--r-- 23.8 KB
sre_compile.py -rw-r--r-- 19.4 KB
sre_constants.py -rw-r--r-- 7.1 KB
sre_parse.py -rw-r--r-- 30.7 KB
ssl.py -rw-r--r-- 33.6 KB
stat.py -rw-r--r-- 4.3 KB
statistics.py -rw-r--r-- 17.4 KB
string.py -rw-r--r-- 11.2 KB
stringprep.py -rw-r--r-- 12.6 KB
struct.py -rw-r--r-- 257 bytes
subprocess.py -rw-r--r-- 62.6 KB
sunau.py -rw-r--r-- 17.6 KB
symbol.py -rwxr-xr-x 2.0 KB
symtable.py -rw-r--r-- 7.2 KB
sysconfig.py -rw-r--r-- 23.9 KB
tabnanny.py -rwxr-xr-x 11.1 KB
tarfile.py -rwxr-xr-x 88.9 KB
telnetlib.py -rw-r--r-- 22.5 KB
tempfile.py -rw-r--r-- 21.2 KB
textwrap.py -rw-r--r-- 18.7 KB
this.py -rw-r--r-- 1003 bytes
threading.py -rw-r--r-- 47.8 KB
timeit.py -rwxr-xr-x 11.5 KB
token.py -rw-r--r-- 3.0 KB
tokenize.py -rw-r--r-- 24.3 KB
trace.py -rwxr-xr-x 30.7 KB
traceback.py -rw-r--r-- 10.9 KB
tracemalloc.py -rw-r--r-- 15.3 KB
tty.py -rw-r--r-- 879 bytes
turtle.py -rw-r--r-- 140.1 KB
types.py -rw-r--r-- 5.3 KB
uu.py -rwxr-xr-x 6.6 KB
uuid.py -rw-r--r-- 23.2 KB
warnings.py -rw-r--r-- 14.0 KB
wave.py -rw-r--r-- 17.3 KB
weakref.py -rw-r--r-- 18.3 KB
webbrowser.py -rwxr-xr-x 20.9 KB
xdrlib.py -rw-r--r-- 5.8 KB
zipfile.py -rw-r--r-- 66.9 KB

back to top