We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18e6597 commit 5853b5cCopy full SHA for 5853b5c
Lib/test/test_bytes.py
@@ -1872,6 +1872,8 @@ def test_repeat_after_setslice(self):
1872
self.assertEqual(b3, b'xcxcxc')
1873
1874
def test_mutating_index(self):
1875
+ # bytearray slice assignment can call into python code
1876
+ # that reallocates the internal buffer
1877
# See gh-91153
1878
1879
class Boom:
@@ -1890,10 +1892,10 @@ def __index__(self):
1890
1892
self._testlimitedcapi.sequence_setitem(b, 0, Boom())
1891
1893
1894
def test_mutating_index_inbounds(self):
- # See gh-91153
1895
+ # gh-91153 continued
1896
+ # Ensure buffer is not broken even if length is correct
1897
1898
class MutatesOnIndex:
-
1899
def __init__(self):
1900
self.ba = bytearray(0x180)
1901
0 commit comments