changeset: 76990:888f5f3bfcb6 branch: 3.2 parent: 76983:57936bd91bcf user: Antoine Pitrou date: Wed May 16 14:37:54 2012 +0200 files: Misc/NEWS Modules/_bisectmodule.c Objects/rangeobject.c description: Issue #14829: Fix bisect and range() indexing with large indices (>= 2 ** 32) under 64-bit Windows. diff -r 57936bd91bcf -r 888f5f3bfcb6 Misc/NEWS --- a/Misc/NEWS Wed May 16 04:48:04 2012 -0400 +++ b/Misc/NEWS Wed May 16 14:37:54 2012 +0200 @@ -63,6 +63,9 @@ Library ------- +- Issue #14829: Fix bisect and range() indexing with large indices + (>= 2 ** 32) under 64-bit Windows. + - Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when accessing the Tk clipboard. Modify clipboad_get() to first request type UTF8_STRING when no specific type is requested in an X11 windowing diff -r 57936bd91bcf -r 888f5f3bfcb6 Modules/_bisectmodule.c --- a/Modules/_bisectmodule.c Wed May 16 04:48:04 2012 -0400 +++ b/Modules/_bisectmodule.c Wed May 16 14:37:54 2012 +0200 @@ -3,6 +3,7 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru). */ +#define PY_SSIZE_T_CLEAN #include "Python.h" static Py_ssize_t @@ -192,7 +193,7 @@ if (PyList_Insert(list, index, item) < 0) return NULL; } else { - result = PyObject_CallMethod(list, "insert", "iO", index, item); + result = PyObject_CallMethod(list, "insert", "nO", index, item); if (result == NULL) return NULL; Py_DECREF(result); diff -r 57936bd91bcf -r 888f5f3bfcb6 Objects/rangeobject.c --- a/Objects/rangeobject.c Wed May 16 04:48:04 2012 -0400 +++ b/Objects/rangeobject.c Wed May 16 14:37:54 2012 +0200 @@ -307,7 +307,7 @@ static PyObject * range_item(rangeobject *r, Py_ssize_t i) { - PyObject *res, *arg = PyLong_FromLong(i); + PyObject *res, *arg = PyLong_FromSsize_t(i); if (!arg) { return NULL; }

AltStyle によって変換されたページ (->オリジナル) /