#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.
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index d6dcffd..da000d0 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -670,7 +670,7 @@
return NULL;
}
if (((dequeobject *)deque)->maxlen != -1)
- fmt = PyString_FromFormat("deque(%%r, maxlen=%" PY_FORMAT_SIZE_T "d)",
+ fmt = PyString_FromFormat("deque(%%r, maxlen=%zd)",
((dequeobject *)deque)->maxlen);
else
fmt = PyString_FromString("deque(%r)");