-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
gh-118714: Make the pdb post-mortem restart/quit behavior more reasonable #118725
Conversation
Hi @iritkatriel , as this is a bug fix, I'd like to make it simple and correct. As I said, printing stuff in So could we maybe do the quick fix first and backport, then I'll make it better in 3.14. |
@@ -0,0 +1 @@ | |||
Make the :mod:`pdb` post-mortem restart/quit message match the behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't very clear. Also, it seems inconsistent with the title of this PR. Are you changing the behaviour (as the title says) or changing the message to match the behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both behavior and message were changed. There were two cases involved, both under post-mortem debugging:
- If the user does
restart
, it actually restarts the program, instead of raising an error and exit. (This is the behavior change). - If the user does
quit
, it quits the program without printing the line saying "we'll restart the program".
I think I should make the behavior change clearer (it's considered a bug fix because quitting the debugger when doing restart
feels wrong).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to change this after the review. Just changed it. Let me know if you think this could be better.
If you want to backport you need the backport labels. We use the green ones on issues. |
Yeah I don't know why I added the issue tags back then. I'll only backport this to 3.13, as that's the version with the behavior change. I'll leave 3.12 alone. |
Thanks @gaogaotiantian for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…reasonable (pythonGH-118725) (cherry picked from commit e245ed7) Co-authored-by: Tian Gao <[email protected]>
GH-121346 is a backport of this pull request to the 3.13 branch. |
Currently the restart and quit behavior of pdb post-mortem debugging mode is a bit weird.
As the issue mentioned, if the user uses
quit
or hit Ctrl+D in post-mortem debugging mode, the debugger will quit, but with a message of the script will be restarted. If the user usesrestart
command, an exception will be raised and the debugger will quit due to the exception.This PR is to clean up the bahaviors. In post-mortem debugging, the user can:
restart
to restartcont
/step
to restart as instructedquit
or Ctrl+D to quitThe message will always informing the users that they are restarting the program if they try to restart, and will quietly quit when they quit.
I would consider this a bug fix so it should not be affected by beta freeze to be merged into 3.13.
pdb
behavior at exit from post-mortem debugger #118714