Commit a103b96a authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #14829: Fix bisect and range() indexing with large indices (>= 2 ** 32) under 64-bit Windows.

parent 5cdc6308
...@@ -63,6 +63,9 @@ Core and Builtins ...@@ -63,6 +63,9 @@ Core and Builtins
Library 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 - Issue #14777: tkinter may return undecoded UTF-8 bytes as a string when
accessing the Tk clipboard. Modify clipboad_get() to first request type accessing the Tk clipboard. Modify clipboad_get() to first request type
UTF8_STRING when no specific type is requested in an X11 windowing UTF8_STRING when no specific type is requested in an X11 windowing
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru). Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
*/ */
#define PY_SSIZE_T_CLEAN
#include "Python.h" #include "Python.h"
static Py_ssize_t static Py_ssize_t
...@@ -192,7 +193,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw) ...@@ -192,7 +193,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
if (PyList_Insert(list, index, item) < 0) if (PyList_Insert(list, index, item) < 0)
return NULL; return NULL;
} else { } else {
result = PyObject_CallMethod(list, "insert", "iO", index, item); result = PyObject_CallMethod(list, "insert", "nO", index, item);
if (result == NULL) if (result == NULL)
return NULL; return NULL;
Py_DECREF(result); Py_DECREF(result);
......
...@@ -307,7 +307,7 @@ compute_range_item(rangeobject *r, PyObject *arg) ...@@ -307,7 +307,7 @@ compute_range_item(rangeobject *r, PyObject *arg)
static PyObject * static PyObject *
range_item(rangeobject *r, Py_ssize_t i) range_item(rangeobject *r, Py_ssize_t i)
{ {
PyObject *res, *arg = PyLong_FromLong(i); PyObject *res, *arg = PyLong_FromSsize_t(i);
if (!arg) { if (!arg) {
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment