https://github.com/python/cpython/commit/3ff35ba47153243a9e174745afb8363ce9007e02
commit: 3ff35ba47153243a9e174745afb8363ce9007e02
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: hugovk <1324225+hug...@users.noreply.github.com>
date: 2025-04-25T17:12:02+03:00
summary:

[3.13] gh-132527: Added missing `w` typecode to array() error message 
(GH-132529) (#132938)

Co-authored-by: Christian Veenhuis <124370897+chv...@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjre...@udel.edu>
Co-authored-by: Tomas R. <tomas.ro...@gmail.com>

files:
A Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst
M Modules/arraymodule.c

diff --git 
a/Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst 
b/Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst
new file mode 100644
index 00000000000000..997cc2b784f7e6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst
@@ -0,0 +1 @@
+Include the valid typecode 'w' in the error message when an invalid typecode 
is passed to :class:`array.array`.
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 600302e1183f99..62a3cca1e948ba 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -2840,7 +2840,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject 
*kwds)
         }
     }
     PyErr_SetString(PyExc_ValueError,
-        "bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)");
+        "bad typecode (must be b, B, u, w, h, H, i, I, l, L, q, Q, f or d)");
     return NULL;
 }
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to