Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 44075:f4e7c729b3a2 2.5
Backport of r59241: str.decode fails on very long strings on 64bit platforms.
PyArgs_ParseTuple t# and w# formats truncated the lengths to 32bit.
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> |
|---|---|
| date | Fri, 30 Nov 2007 21:53:17 +0000 |
| parents | 798935e1295e |
| children | 787b969d37f0 |
line wrap: on
line diff
--- a/Python/getargs.c Thu Nov 29 18:33:04 2007 +0000 +++ b/Python/getargs.c Fri Nov 30 21:53:17 2007 +0000 @@ -894,7 +894,8 @@ char **buffer; const char *encoding; PyObject *s; - int size, recode_strings; + Py_ssize_t size; + int recode_strings; /* Get 'e' parameter: the encoding name */ encoding = (const char *)va_arg(*p_va, const char *); @@ -1144,7 +1145,7 @@ case 'w': { /* memory buffer, read-write access */ void **p = va_arg(*p_va, void **); PyBufferProcs *pb = arg->ob_type->tp_as_buffer; - int count; + Py_ssize_t count; if (pb == NULL || pb->bf_getwritebuffer == NULL || @@ -1166,7 +1167,7 @@ case 't': { /* 8-bit character buffer, read-only access */ char **p = va_arg(*p_va, char **); PyBufferProcs *pb = arg->ob_type->tp_as_buffer; - int count; + Py_ssize_t count; if (*format++ != '#') return converterr(
