Reported by John Leitch and Bryce Darling, patch by Raymond Hettinger.
else:
self.assertEqual(d.index(element, start, stop), target)
+ def test_insert_bug_24913(self):
+ d = deque('A' * 3)
+ with self.assertRaises(ValueError):
+ i = d.index("Hello world", 0, 4)
+
def test_insert(self):
# Test to make sure insert behaves like lists
elements = 'ABCDEFGHI'
Library
-------
+- Issue #24913: Fix overrun error in deque.index().
+ Found by John Leitch and Bryce Darling.
+
What's New in Python 3.5.0 release candidate 2?
===============================================
if (stop < 0)
stop = 0;
}
+ if (stop > Py_SIZE(deque))
+ stop = Py_SIZE(deque);
for (i=0 ; i<stop ; i++) {
if (i >= start) {