cpython
cpython copied to clipboard
gh-125666: Avoid PyREPL exiting when a null byte is in input
This PR adds a guard against SyntaxError.lineno being None in code.InteractiveInterpreter._showtraceback, which should avoid PyREPL 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.
- Issue: gh-125666
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.
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!
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. 🐍🍒⛏🤖
GH-126023 is a backport of this pull request to the 3.13 branch.