From: Thomas Wouters Date: Thu, 16 Feb 2006 19:34:37 +0000 (+0000) Subject: Use correct PyArg_Parse format char for Py_ssize_t in unicode.center(). X-Git-Tag: v2.5a0~645 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de01774dae6771aa5abdaca2ef39e339ad223f8d;p=python Use correct PyArg_Parse format char for Py_ssize_t in unicode.center(). Fixes: >>> u"".center(10) Traceback (most recent call last): File "", line 1, in MemoryError on 64-bit systems. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index eaf98372c8..d353f1fc7a 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -4853,7 +4853,7 @@ unicode_center(PyUnicodeObject *self, PyObject *args) Py_ssize_t width; Py_UNICODE fillchar = ' '; - if (!PyArg_ParseTuple(args, "i|O&:center", &width, convert_uc, &fillchar)) + if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar)) return NULL; if (self->length >= width && PyUnicode_CheckExact(self)) {