mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264)
This commit is contained in:
parent
10f8ce6688
commit
d53fe5f407
20 changed files with 35 additions and 35 deletions
|
@ -1210,7 +1210,7 @@ PyObject *_PyBytes_DecodeEscape(const char *s,
|
|||
|
||||
if (!errors || strcmp(errors, "strict") == 0) {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"invalid \\x escape at position %d",
|
||||
"invalid \\x escape at position %zd",
|
||||
s - 2 - (end - len));
|
||||
goto failed;
|
||||
}
|
||||
|
|
|
@ -1539,7 +1539,7 @@ odict_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
if (len == -1)
|
||||
return -1;
|
||||
if (len > 1) {
|
||||
const char *msg = "expected at most 1 arguments, got %d";
|
||||
const char *msg = "expected at most 1 arguments, got %zd";
|
||||
PyErr_Format(PyExc_TypeError, msg, len);
|
||||
return -1;
|
||||
}
|
||||
|
@ -2213,7 +2213,7 @@ mutablemapping_update(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
assert(args == NULL || PyTuple_Check(args));
|
||||
len = (args != NULL) ? PyTuple_GET_SIZE(args) : 0;
|
||||
if (len > 1) {
|
||||
const char *msg = "update() takes at most 1 positional argument (%d given)";
|
||||
const char *msg = "update() takes at most 1 positional argument (%zd given)";
|
||||
PyErr_Format(PyExc_TypeError, msg, len);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ structseq_repr(PyStructSequence *obj)
|
|||
|
||||
cname = typ->tp_members[i].name;
|
||||
if (cname == NULL) {
|
||||
PyErr_Format(PyExc_SystemError, "In structseq_repr(), member %d name is NULL"
|
||||
PyErr_Format(PyExc_SystemError, "In structseq_repr(), member %zd name is NULL"
|
||||
" for type %.500s", i, typ->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue