diff -r ae6813d21859 Modules/_ctypes/_ctypes.c --- a/Modules/_ctypes/_ctypes.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/_ctypes/_ctypes.c Fri Sep 23 22:25:22 2016 +0300 @@ -3250,7 +3250,10 @@ /* Here ftuple is a borrowed reference */ return NULL; - if (!PyArg_ParseTuple(ftuple, "O&O", _get_name, &name, &dll)) { + if (!PyArg_ParseTuple(ftuple, + "O&O;PyCFuncPtr.__new__: illegal function name and " + "dll object sequence argument", + _get_name, &name, &dll)) { Py_DECREF(ftuple); return NULL; } diff -r ae6813d21859 Modules/_io/textio.c --- a/Modules/_io/textio.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/_io/textio.c Fri Sep 23 22:25:22 2016 +0300 @@ -569,8 +569,11 @@ PyObject *buffer; unsigned long long flag; - if (!PyArg_ParseTuple(state, "OK", &buffer, &flag)) + if (!PyArg_ParseTuple(state, + "OK;IncrementalNewlineDecoder.setstate: illegal " + "state argument", &buffer, &flag)) { return NULL; + } self->pendingcr = (int) (flag & 1); flag >>= 1; diff -r ae6813d21859 Modules/audioop.c --- a/Modules/audioop.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/audioop.c Fri Sep 23 22:25:22 2016 +0300 @@ -1365,9 +1365,10 @@ } for (chan = 0; chan < nchannels; chan++) { if (!PyArg_ParseTuple(PyTuple_GetItem(samps, chan), - "ii:ratecv", &prev_i[chan], - &cur_i[chan])) + "ii;audioop.ratecv: illegal state argument", + &prev_i[chan], &cur_i[chan])) { goto exit; + } } } @@ -1638,7 +1639,9 @@ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None"); return NULL; } - else if (!PyArg_ParseTuple(state, "ii", &valpred, &index)) { + else if (!PyArg_ParseTuple(state, + "ii;audioop.lin2adpcm: illegal state argument", + &valpred, &index)) { return NULL; } else if (valpred >= 0x8000 || valpred < -0x8000 || @@ -1766,7 +1769,9 @@ PyErr_SetString(PyExc_TypeError, "state must be a tuple or None"); return NULL; } - else if (!PyArg_ParseTuple(state, "ii", &valpred, &index)) { + else if (!PyArg_ParseTuple(state, + "ii;audioop.adpcm2lin: illegal state argument", + &valpred, &index)) { return NULL; } else if (valpred >= 0x8000 || valpred < -0x8000 || diff -r ae6813d21859 Modules/itertoolsmodule.c --- a/Modules/itertoolsmodule.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/itertoolsmodule.c Fri Sep 23 22:25:22 2016 +0300 @@ -147,8 +147,11 @@ groupby_setstate(groupbyobject *lz, PyObject *state) { PyObject *currkey, *currvalue, *tgtkey; - if (!PyArg_ParseTuple(state, "OOO", &currkey, &currvalue, &tgtkey)) + if (!PyArg_ParseTuple(state, + "OOO;groupby.__setstate__: illegal state argument", + &currkey, &currvalue, &tgtkey)) { return NULL; + } Py_INCREF(currkey); Py_XSETREF(lz->currkey, currkey); Py_INCREF(currvalue); @@ -727,8 +730,11 @@ { teedataobject *tdo; int index; - if (!PyArg_ParseTuple(state, "O!i", &teedataobject_type, &tdo, &index)) + if (!PyArg_ParseTuple(state, + "O!i;_tee.__setstate__: illegal state argument", + &teedataobject_type, &tdo, &index)) { return NULL; + } if (index < 0 || index > LINKCELLS) { PyErr_SetString(PyExc_ValueError, "Index out of range"); return NULL; @@ -972,8 +978,11 @@ PyObject *saved=NULL; int firstpass; - if (!PyArg_ParseTuple(state, "O!i", &PyList_Type, &saved, &firstpass)) + if (!PyArg_ParseTuple(state, + "O!i;cycle.__setstate__: illegal state argument", + &PyList_Type, &saved, &firstpass)) { return NULL; + } Py_INCREF(saved); Py_XSETREF(lz->saved, saved); lz->firstpass = firstpass != 0; @@ -1903,8 +1912,11 @@ { PyObject *source, *active=NULL; - if (! PyArg_ParseTuple(state, "O|O", &source, &active)) + if (!PyArg_ParseTuple(state, + "O|O;chain.__setstate__: illegal state argument", + &source, &active)) { return NULL; + } Py_INCREF(source); Py_XSETREF(lz->source, source); @@ -3262,10 +3274,12 @@ PyObject *indices, *cycles, *result; Py_ssize_t n, i; - if (!PyArg_ParseTuple(state, "O!O!", - &PyTuple_Type, &indices, - &PyTuple_Type, &cycles)) + if (!PyArg_ParseTuple(state, + "O!O!;permutations.__setstate__: illegal state " + "argument", &PyTuple_Type, &indices, + &PyTuple_Type, &cycles)) { return NULL; + } n = PyTuple_GET_SIZE(po->pool); if (PyTuple_GET_SIZE(indices) != n || PyTuple_GET_SIZE(cycles) != po->r) { diff -r ae6813d21859 Modules/overlapped.c --- a/Modules/overlapped.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/overlapped.c Fri Sep 23 22:25:22 2016 +0300 @@ -990,7 +990,9 @@ ((SOCKADDR_IN*)Address)->sin_port = htons(Port); return Length; } - else if (PyArg_ParseTuple(obj, "uHkk", &Host, &Port, &FlowInfo, &ScopeId)) + else if (PyArg_ParseTuple(obj, + "uHkk;ConnectEx: illegal address_as_bytes " + "argument", &Host, &Port, &FlowInfo, &ScopeId)) { PyErr_Clear(); Address->sa_family = AF_INET6; diff -r ae6813d21859 Modules/socketmodule.c --- a/Modules/socketmodule.c Thu Sep 22 11:43:46 2016 +0300 +++ b/Modules/socketmodule.c Fri Sep 23 22:25:22 2016 +0300 @@ -6079,12 +6079,14 @@ "getnameinfo() argument 1 must be a tuple"); return NULL; } - if (!PyArg_ParseTuple(sa, "si|II", - &hostp, &port, &flowinfo, &scope_id)) + if (!PyArg_ParseTuple(sa, + "si|II;getnameinfo: illegal sockaddr argument", + &hostp, &port, &flowinfo, &scope_id)) { return NULL; + } if (flowinfo > 0xfffff) { PyErr_SetString(PyExc_OverflowError, - "getsockaddrarg: flowinfo must be 0-1048575."); + "getnameinfo: flowinfo must be 0-1048575."); return NULL; } PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port);