cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-125666: Avoid PyREPL exiting when a null byte is in input

Open devdanzin opened this issue 1 year ago • 2 comments

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

devdanzin avatar Oct 19 '24 15:10 devdanzin

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.

devdanzin avatar Oct 21 '24 14:10 devdanzin

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!

ZeroIntensity avatar Oct 24 '24 13:10 ZeroIntensity

Thanks for the contribution @devdanzin and thanks @ZeroIntensity for the review!

pablogsal avatar Oct 27 '24 00:10 pablogsal

Thanks @devdanzin for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. 🐍🍒⛏🤖

miss-islington-app[bot] avatar Oct 27 '24 01:10 miss-islington-app[bot]

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

bedevere-app[bot] avatar Oct 27 '24 01:10 bedevere-app[bot]