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

gh-87320: dont crash in code module with bad sys.excepthook #122456

Conversation

cfbolz
Copy link
Contributor

@cfbolz cfbolz commented Jul 30, 2024

Catch errors in code.InteractiveCodeInterpreter when calling sys.excepthook fails. Report them in the same style that the classic interpreter has reported them.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) July 31, 2024 10:32
@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Jul 31, 2024
@serhiy-storchaka serhiy-storchaka merged commit bd3d31f into python:main Jul 31, 2024
36 checks passed
@miss-islington-app
Copy link

Thanks @cfbolz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 31, 2024
…xcepthook (pythonGH-122456)

Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
@miss-islington-app
Copy link

Sorry, @cfbolz and @serhiy-storchaka, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker bd3d31f380cd451a4ab6da5fbfde463fed95b5b5 3.12

@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122514 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 31, 2024
@serhiy-storchaka
Copy link
Member

Thank you for your contribution @cfbolz. Your responses were very quick and of high quality.

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jul 31, 2024
…n sys.excepthook (pythonGH-122456)

Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
@bedevere-app
Copy link

bedevere-app bot commented Jul 31, 2024

GH-122515 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jul 31, 2024
@cfbolz
Copy link
Contributor Author

cfbolz commented Jul 31, 2024

@serhiy-storchaka thanks a lot for the review and your help!

serhiy-storchaka added a commit that referenced this pull request Jul 31, 2024
…excepthook (GH-122456) (GH-122515)

Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
serhiy-storchaka pushed a commit that referenced this pull request Aug 8, 2024
…excepthook (GH-122456) (GH-122514)

Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
…xcepthook (pythonGH-122456)

Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants