Issue #8651: Fix "z#" format of PyArg_Parse*() function: the size was not
written if PY_SSIZE_T_CLEAN is defined.
diff --git a/Python/getargs.c b/Python/getargs.c
index 7c3e9fa..02351ed 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -984,10 +984,11 @@
if (*format == '#') {
FETCH_SIZE;
assert(0); /* XXX redundant with if-case */
- if (arg == Py_None)
- *q = 0;
- else
- *q = PyString_Size(arg);
+ if (arg == Py_None) {
+ STORE_SIZE(0);
+ } else {
+ STORE_SIZE(PyString_Size(arg));
+ }
format++;
}
else if (*p != NULL &&