mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.12] gh-77894: Fix a crash when the GC breaks a loop containing a memoryview (GH-123898) (GH-123937)
Now a memoryview object can only be cleared if there are no buffers
that refer it.
(cherry picked from commit a1dbf2ea69
)
This commit is contained in:
parent
c6ae90a63c
commit
90e5bd7ed2
4 changed files with 57 additions and 33 deletions
|
@ -2019,12 +2019,10 @@ class AbstractPicklingErrorTests:
|
|||
'PickleBuffer can only be pickled with protocol >= 5')
|
||||
|
||||
def test_non_continuous_buffer(self):
|
||||
if self.pickler is pickle._Pickler:
|
||||
self.skipTest('CRASHES (see gh-122306)')
|
||||
for proto in protocols[5:]:
|
||||
with self.subTest(proto=proto):
|
||||
pb = pickle.PickleBuffer(memoryview(b"foobar")[::2])
|
||||
with self.assertRaises(pickle.PicklingError):
|
||||
with self.assertRaises((pickle.PicklingError, BufferError)):
|
||||
self.dumps(pb, proto)
|
||||
|
||||
def test_buffer_callback_error(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue