diff -r 6ef65516fd7a -r 6394321ef4ec Modules/_pickle.c --- a/Modules/_pickle.c Tue Aug 09 16:07:01 2011 -0500 +++ b/Modules/_pickle.c Wed Aug 10 12:10:06 2011 +0100 @@ -4804,7 +4804,7 @@ static int load_put(UnpicklerObject *self) { - PyObject *key, *value; + PyObject *value; Py_ssize_t idx; Py_ssize_t len; char *s; @@ -4817,11 +4817,8 @@ return stack_underflow(); value = self->stack->data[Py_SIZE(self->stack) - 1]; - key = PyLong_FromString(s, NULL, 10); - if (key == NULL) - return -1; - idx = PyLong_AsSsize_t(key); - Py_DECREF(key); + idx = PyOS_strtol(s, NULL, 10); + if (idx == -1 && PyErr_Occurred()) return -1;