tomasr8 · GitHub

Bug report

Bug description:

This issue is suitable for a first-time contributor.

The 'w' typecode is supported but the error message does not mention it:

>>> array('x')
Traceback (most recent call last):
  File "<python-input-5>", line 1, in <module>
    array('x')
    ~~~~~^^^^^
ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)

We should add 'w' to the list. This is the relevant part of the code that should be updated:

PyErr_SetString(PyExc_ValueError,
"bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)");
return NULL;

Happy to help if you have any questions!

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Read the original on github.com ↗