You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PyArg_ParseTuple(args, "u#", ...) misbehaves with -Werror #94864
PyArg_ParseTuple(args, "u#", ...) generates a deprecation warning, as expected:
$ python3 --versionPython 3.11.0b4
$ python3 -c 'import _testcapi as t; t.getargs_u_hash("")'<string>:1: DeprecationWarning: getargs: The 'u' format is deprecated. Use 'U' instead.
But when I turn warnings into exceptions, something weird happens:
$ python3 -Werror -c 'import _testcapi as t; t.getargs_u_hash("")'Traceback (most recent call last): File "<string>", line 1, in <module>ValueError: character U+b4000360 is not in range [U+0000; U+10ffff]
What's going on here? The code for getargs_u_hash() looks like this:
Py_UNICODE*str;
Py_ssize_tsize;
if (!PyArg_ParseTuple(args, "u#", &str, &size))
returnNULL;
returnPyUnicode_FromWideChar(str, size);
So it looks like PyArg_ParseTuple() returns true, but leaves str and size uninitialized.
Activity
pythongh-94864: Fix PyArg_Parse* with deprecated format units "u" and…
pythongh-94864: Fix PyArg_Parse* with deprecated format units "u" and…
gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (G…
gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (G…