Index: Lib/json/tests/test_scanstring.py =================================================================== --- Lib/json/tests/test_scanstring.py (révision 72287) +++ Lib/json/tests/test_scanstring.py (copie de travail) @@ -107,3 +107,6 @@ "xxx") self.assertRaises(UnicodeDecodeError, json.encoder.encode_basestring_ascii, b"xx\xff") + + def test_overflow(self): + self.assertRaises(OverflowError, json.decoder.scanstring, b"xxx", sys.maxsize+1) --- Modules/_json.c.orig 2009-05-05 02:21:09.000000000 +0200 +++ Modules/_json.c 2009-05-05 02:20:54.000000000 +0200 @@ -143,9 +143,9 @@ { /* PyObject to Py_ssize_t converter */ *size_ptr = PyInt_AsSsize_t(o); - if (*size_ptr == -1 && PyErr_Occurred()); - return 1; - return 0; + if (*size_ptr == -1 && PyErr_Occurred()) + return 0; + return 1; } static PyObject *