mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.13] gh-122431: Disallow negative values in readline.append_history_file
(GH-122469) (#127641)
gh-122431: Disallow negative values in `readline.append_history_file` (GH-122469)
(cherry picked from commit 208b0fb645
)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
3e11b5c2ba
commit
468e8dad7e
3 changed files with 15 additions and 0 deletions
|
@ -114,6 +114,14 @@ class TestHistoryManipulation (unittest.TestCase):
|
|||
# write_history_file can create the target
|
||||
readline.write_history_file(hfilename)
|
||||
|
||||
# Negative values should be disallowed
|
||||
with self.assertRaises(ValueError):
|
||||
readline.append_history_file(-42, hfilename)
|
||||
|
||||
# See gh-122431, using the minimum signed integer value caused a segfault
|
||||
with self.assertRaises(ValueError):
|
||||
readline.append_history_file(-2147483648, hfilename)
|
||||
|
||||
def test_nonascii_history(self):
|
||||
readline.clear_history()
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue