gh-71136: Fix IDLE Shell hang after KeyboardInterrupt under the debugger - #157566
Conversation
… debugger Code run under the debugger bypasses Executive.runcode(), so the KeyboardInterrupt reached the request loop in run.main(), which did not reply to the request. Report it and reply, but only if a request was being executed. Co-authored-by: Louie Lu <git@louie.lu> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
I do not see any issue with raise SystemExit in debugged code, so I think this finishes issue.
EDIT add below:
It does not hang, but restarts, so not same as usual. Fix might not be same. Less critical, other issues more important.
Keyboard Control-C does not have bad effect for me even on 3.15. So changed message above a bit.
There is a separate issue about [DEBUG ON] being on line with prompt. Maybe move to status bar.
|
Thanks @serhiy-storchaka for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-158204 is a backport of this pull request to the 3.15 branch. |
|
GH-158205 is a backport of this pull request to the 3.14 branch. |
|
GH-158206 is a backport of this pull request to the 3.13 branch. |
…e debugger (GH-157566) (#158206) gh-71136: Fix IDLE Shell hang after KeyboardInterrupt under the debugger (GH-157566) Debugging 'raise KeyboardInterrupt' in debugged code no longer hangs IDLE forever. The response is similar to without the debugger. --------- (cherry picked from commit ee1bbf0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…e debugger (GH-157566) (#158205) gh-71136: Fix IDLE Shell hang after KeyboardInterrupt under the debugger (GH-157566) Debugging 'raise KeyboardInterrupt' in debugged code no longer hangs IDLE forever. The response is similar to without the debugger. --------- (cherry picked from commit ee1bbf0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Code run under the debugger goes through
IdbAdapter.run(), notExecutive.runcode(), so aKeyboardInterrupt(raised by the code, or Ctrl-C while paused) reached the request loop inrun.main(), which dropped it without replying. The GUI then waited forever.Now it is reported, as without the debugger, and replied to — but only if a request was being executed, unlike #1711/#141328, which reply unconditionally and print nothing.
The Shell restart on
SystemExitunder the debugger, the other half of gh-71136, has the same origin and can be fixed separately.🤖 Generated with Claude Code