-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make IPython.core.debugger interruptible by KeyboardInterrupt #12168
Conversation
Thanks, marking as 7.14. There seem to be some unexpected interaction as IPython tests are failing, but they should not depend on PyZMQ. I'll have to dig into this. |
I can take a look too, just, step 1 is convincing pyzmq maintainer to accept that PR (or convincing myself that PR is not necessary). |
if that's @minrk then he can also merge the fixes here if necessary and likely do synchronized releases. |
Ah, great, just need to convince him it's necessary :) |
Looks like I was wrong and pyzmq is fine, so just down to these two PRs. |
…plemented in ipykernel.
After further research, I have determined that the interrupt mechanism used by ipykernel on Windows doesn't interrupt pdb (or rather, I suspect, Unfortunately this will require some corresponding changes to ipykernel, and still has some... oddities. Like, I need to send the signal multiple times (perhaps there's a race condition? A flag that needs to be set?). Python 3.6 isn't working in AppVeyor so that suggests more issues. If I can just get it working on e.g. POSIX plus Python 3.8 Windows that will still be an improvement, so I will try to do that next. |
…e issues with with Windows, that will be addressed in ipykernel (which will grow its own test).
I switched to a simpler test that doesn't involve subprocesses. I will next try to write a process-interrupting test in an ipykernel branch, which is a better place to do it since it is the one that actually implements that logic, and see if I can fix the Windows issue I encountered there. |
… we don't impact existing usage behavior.
@Carreau OK I think this is ... plausibly maybe even correct and working now 😁 |
OK, let's try. |
…y KeyboardInterrupt
…168-on-7.x Backport PR #12168 on branch 7.x (Make IPython.core.debugger interruptible by KeyboardInterrupt)
@tonyfast It happens in |
Is there an option or flag to not do this? I don't want to use pdb and it is disrupting a testing pattern in the stdlib module which is harshing my buzz. |
Could this be something that the |
Together with a number of other PRs, this is a step towards addressing #10516
There are three issues:
IPython.core.debugger
would swallow KeyboardInterrupts and not let them get raised. This fixes that issue in a new class,InterruptiblePdb
, so as not to change existing behavior.pdb
had the same issue, and by default all debuggers in Jupyter kernel usage need to be interruptible by KeyboardInterrupt to fix this bug. Make pdb on Windows interruptible ipykernel#490 overrides pdb and the default debugger to use the newInterruptiblePdb
.input()
. Fixed by Allow interrupting input() on Windows, as part of effort to make pdb interruptible ipykernel#498