New submission from Xavier de Gaye: With this script: # START def foo(): while 1: pass
import pdb; pdb.set_trace() foo() # END The following sequence of pdb commands aborts the script with a KeyboardInterrupt exception: next Ctrl-C continue While the equivalent following sequence of commands allows the debugging session to continue as expected: continue Ctrl-C continue The first sequence of commands should behave as the second one. A related problem is that the original SIGINT handler (named _previous_sigint_handler in the code) is not restored when the program being debugged is stopped at a breakpoint that has been reached after 'continue'. _previous_sigint_handler is lost forever in this case when the user hits 'continue' after stopping at that breakpoint, which is quite common. This is annoying. For example, trying to extend pdb with a 'detach' command that enables the debuggee to run freely after the debugging session is terminated: the program cannot be killed anymore with SIGINT when the above case occurs. The attached patch attempts to fix these problems. After applying the attached patch, the behavior of the 'next, Ctrl-C, continue' sequence of commands is still wrong: this is another bug logged at issue 14788 with a patch and a test. Applying patch 14788 fixes this. ---------- components: Library (Lib) files: sigint.patch keywords: patch messages: 208151 nosy: georg.brandl, xdegaye priority: normal severity: normal status: open title: Inconsistent behavior in pdb when pressing Ctrl-C type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file33478/sigint.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20269> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com