#3743: PY_FORMAT_SIZE_T is designed for the OS "printf" functions, not for

PyString_FromFormat which has an independent implementation, and uses "%zd".

This makes a difference on win64, where printf needs "%Id" to display
64bit values. For example, queue.__repr__ was incorrect.

Reviewed by Martin von Loewis.
This commit is contained in:
Amaury Forgeot d'Arc 2008-09-10 22:04:45 +00:00
parent 4dd3a50ca4
commit 05e344954d
5 changed files with 13 additions and 6 deletions

View file

@ -387,7 +387,7 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields != PyTuple_GET_SIZE(args)) {
PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
"%" PY_FORMAT_SIZE_T "d positional argument%s",
"%zd positional argument%s",
Py_TYPE(self)->tp_name,
numfields == 0 ? "" : "either 0 or ",
numfields, numfields == 1 ? "" : "s");