mirror of
https://github.com/python/cpython.git
synced 2025-11-07 09:02:02 +00:00
[3.13] gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732) (#126023)
gh-125666: Avoid PyREPL exiting when a null byte is in input (GH-125732)
(cherry picked from commit 44becb8cba)
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
This commit is contained in:
parent
b1051577de
commit
fd48d98df9
4 changed files with 17 additions and 1 deletions
|
|
@ -1313,6 +1313,11 @@ def test_proper_tracebacklimit(self):
|
|||
self.assertIn("in x3", output)
|
||||
self.assertIn("in <module>", output)
|
||||
|
||||
def test_null_byte(self):
|
||||
output, exit_code = self.run_repl("\x00\nexit()\n")
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertNotIn("TypeError", output)
|
||||
|
||||
def test_readline_history_file(self):
|
||||
# skip, if readline module is not available
|
||||
readline = import_module('readline')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue