Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 514686
Collapse All | Expand All

(-)Python-2.7.6.orig/Lib/json/tests/test_decode.py (+5 lines)
Lines 60-64 Link Here
60
        msg = 'escape'
60
        msg = 'escape'
61
        self.assertRaisesRegexp(ValueError, msg, self.loads, s)
61
        self.assertRaisesRegexp(ValueError, msg, self.loads, s)
62
62
63
    def test_negative_index(self):
64
        d = self.json.JSONDecoder()
65
        self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
66
        self.assertRaises(ValueError, d.raw_decode, u'a'*42, -50000)
67
63
class TestPyDecode(TestDecode, PyTest): pass
68
class TestPyDecode(TestDecode, PyTest): pass
64
class TestCDecode(TestDecode, CTest): pass
69
class TestCDecode(TestDecode, CTest): pass
(-)Python-2.7.6.orig/Misc/ACKS (+1 lines)
Lines 1085-1090 Link Here
1085
Frank Visser
1085
Frank Visser
1086
Johannes Vogel
1086
Johannes Vogel
1087
Alex Volkov
1087
Alex Volkov
1088
Guido Vranken
1088
Martijn Vries
1089
Martijn Vries
1089
Niki W. Waibel
1090
Niki W. Waibel
1090
Wojtek Walczak
1091
Wojtek Walczak
(-)Python-2.7.6.orig/Modules/_json.c (-2 / +8 lines)
Lines 1491-1497 Link Here
1491
    PyObject *res;
1491
    PyObject *res;
1492
    char *str = PyString_AS_STRING(pystr);
1492
    char *str = PyString_AS_STRING(pystr);
1493
    Py_ssize_t length = PyString_GET_SIZE(pystr);
1493
    Py_ssize_t length = PyString_GET_SIZE(pystr);
1494
    if (idx >= length) {
1494
    if (idx < 0)
1495
        /* Compatibility with the Python version. */
1496
        idx += length;
1497
    if (idx < 0 || idx >= length) {
1495
        PyErr_SetNone(PyExc_StopIteration);
1498
        PyErr_SetNone(PyExc_StopIteration);
1496
        return NULL;
1499
        return NULL;
1497
    }
1500
    }
Lines 1578-1584 Link Here
1578
    PyObject *res;
1581
    PyObject *res;
1579
    Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr);
1582
    Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr);
1580
    Py_ssize_t length = PyUnicode_GET_SIZE(pystr);
1583
    Py_ssize_t length = PyUnicode_GET_SIZE(pystr);
1581
    if (idx >= length) {
1584
    if (idx < 0)
1585
        /* Compatibility with Python version. */
1586
        idx += length;
1587
    if (idx < 0 || idx >= length) {
1582
        PyErr_SetNone(PyExc_StopIteration);
1588
        PyErr_SetNone(PyExc_StopIteration);
1583
        return NULL;
1589
        return NULL;
1584
    }
1590
    }

Return to bug 514686