Skip to content
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

fix uncaught BdbQuit exceptions on ipdb exit #13668

Merged
merged 1 commit into from May 3, 2022

Conversation

telamonian
Copy link
Contributor

@telamonian telamonian commented May 2, 2022

fixes:

refs:

BdbQuit is now handled in the top-most scope of InteractiveShell.run_code. This ensures that BdbQuit is correctly handled but can still do its job of breaking out of all user code/loops/further breakpoint requests. Hopefully will work better than previous attempts, which put the BdqQuit handling in Pdb.set_trace.

In terms of ipdb integration with the jlab UI, it's a big improvement.

Before:
image

After:
image

Much less noisy

pinging @Carreau for a review

@telamonian
Copy link
Contributor Author

I also tested to make sure that the change in this PR is compatible with the work done in #9942 and #9950 to enable running terminal.debugger as main, eg:

python -m IPython.terminal.debugger testDebug.py

and it seems to be compatible. However, there were other strange problems relating to imports that did keep the python -m <some debugger> ... stuff from working. I was able to work around those issues by shuffling some imports from top level to under the TerminalPdb class scope. It's out of scope for this PR, tho, so I'll open a new issue about that

- `BdbQuit` is now handled in the top-most scope of `InteractiveShell.run_code`. This ensures that `BdbQuit` is correctly handled but can still do its job of breaking out of all user code/loops/further breakpoint requests. Hopefully will work better than previous attempts, which put the `BdqQuit` handling in `Pdb.set_trace`

- fixes:
  - jupyterlab/jupyterlab#12501

- refs:
  - ipython#876
  - ipython#1273
  - ipython#4474
  - ipython#5306
  - ipython#9731
  - ipython#9942
  - ipython#9950
  - ipython#10006
  - ipython#12378
# vscode ide stuff
*.code-workspace
.history
.vscode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really all these should be in your gitignore global:

https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

@Carreau Carreau added this to the 7.34 milestone May 3, 2022
@Carreau Carreau merged commit 1893a8f into ipython:master May 3, 2022
@Carreau
Copy link
Member

Carreau commented May 11, 2022

@meeseeksdev backport to 7.x

@lumberbot-app
Copy link
Contributor

lumberbot-app bot commented May 11, 2022

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 7.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 1893a8f59482626cf3a20ea7dd63379d97c026ea
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #13668: fix uncaught `BdbQuit` exceptions on ipdb `exit`'
  1. Push to a named branch:
git push YOURFORK 7.x:auto-backport-of-pr-13668-on-7.x
  1. Create a PR against branch 7.x, I would have named this PR:

"Backport PR #13668 on branch 7.x (fix uncaught BdbQuit exceptions on ipdb exit)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@lumberbot-app lumberbot-app bot added the Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR. label May 11, 2022
Carreau added a commit to Carreau/ipython that referenced this pull request May 28, 2022
Carreau added a commit that referenced this pull request May 28, 2022
Backport PR #13668: fix uncaught `BdbQuit` exceptions on ipdb `exit`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Still Needs Manual Backport Added My MrMeeseeks when a backport fails. Help by backporting it, solving conflicts, send PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants