https://github.com/python/cpython/commit/a9a8ca3e47d0b3622dba5a82df8cc888d0fbffb5
commit: a9a8ca3e47d0b3622dba5a82df8cc888d0fbffb5
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2025-12-23T04:59:43Z
summary:

[3.13] gh-122431: Correct the non-negative error message in 
`readline.append_history_file` (GH-143075) (GH-143091)

gh-122431: Correct the non-negative error message in 
`readline.append_history_file` (GH-143075)

"positive" -> "non-negative", since zero is included.
(cherry picked from commit a273bc99d2ff853f59ee6da4d897b1be72a03975)

Co-authored-by: Zheng Yu <[email protected]>

files:
A Misc/NEWS.d/next/Library/2025-12-22-22-36-21.gh-issue-122431.9E3085.rst
M Modules/readline.c

diff --git 
a/Misc/NEWS.d/next/Library/2025-12-22-22-36-21.gh-issue-122431.9E3085.rst 
b/Misc/NEWS.d/next/Library/2025-12-22-22-36-21.gh-issue-122431.9E3085.rst
new file mode 100644
index 00000000000000..8936ac9395f743
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-12-22-22-36-21.gh-issue-122431.9E3085.rst
@@ -0,0 +1 @@
+Corrected the error message in :func:`readline.append_history_file` to state 
that ``nelements`` must be non-negative instead of positive.
diff --git a/Modules/readline.c b/Modules/readline.c
index 7d1f703f7dbdde..f9362c312de922 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -353,7 +353,7 @@ readline_append_history_file_impl(PyObject *module, int 
nelements,
 {
     if (nelements < 0)
     {
-        PyErr_SetString(PyExc_ValueError, "nelements must be positive");
+        PyErr_SetString(PyExc_ValueError, "nelements must be non-negative");
         return NULL;
     }
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to