diff -r 09f22b5d6cea Lib/pydoc.py --- a/Lib/pydoc.py Sun Mar 29 17:09:21 2015 -0400 +++ b/Lib/pydoc.py Sun Mar 29 20:13:41 2015 -0400 @@ -1451,7 +1451,12 @@ proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE) try: with io.TextIOWrapper(proc.stdin, errors='backslashreplace') as pipe: - pipe.write(text) + try: + pipe.write(text) + except KeyboardInterrupt: + # We've hereby abandoned whatever text hasn't been written, + # but the pager is still in control of the terminal. + pass except OSError: pass # Ignore broken pipes caused by quitting the pager program. while True: