-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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-125666: Avoid PyREPL exiting when a null byte is in input #125732
Conversation
…reter._showtraceback.
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.
Combining the with statements: I merged the two with statements into a single line for conciseness, which is valid Python syntax.
Thank you very much! If you can, propose it as a code change and I'll accept it, so your contribution gets recorded in a commit. |
That person was a bot user, sorry! |
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 think this looks fine.
Thanks for the contribution @devdanzin and thanks @ZeroIntensity for the review! |
Thanks @devdanzin for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ythonGH-125732) (cherry picked from commit 44becb8) Co-authored-by: devdanzin <[email protected]>
GH-126023 is a backport of this pull request to the 3.13 branch. |
This PR adds a guard against
SyntaxError.lineno
beingNone
incode.InteractiveInterpreter._showtraceback
, which should avoidPyREPL
exiting the interpreter when a null byte is present in the input.Not sure both new tests are necessary, happy to remove one or the other if it's better.