]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-148914: Fix memoization of in-band PickleBuffer in the Python implementatio...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 2 May 2026 11:11:15 +0000 (13:11 +0200)
committerGitHub <noreply@github.com>
Sat, 2 May 2026 11:11:15 +0000 (11:11 +0000)
commit302ef2122c65aa89e0ef70f20198d2c368701244
treec1a38d5ae59c57a2db6a82ac33345fd910cd42e6
parent22fdd355b1f49bd5ca14a35de8f13a3949cd5c6a
[3.13] gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation (GH-149052) (GH-149275)

Previously, identical PickleBuffers did not preserve identity.
Also, empty writable PickleBuffer memoized an empty bytearray object
in place of b'' which is a singleton in CPython, so the following
references to b'' were unpickled as an empty bytearray object.
(cherry picked from commit b89735625dff07005c31bdc86cbe7113ef1b59d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/pickle.py
Lib/test/pickletester.py
Misc/NEWS.d/next/Library/2026-04-27-17-12-11.gh-issue-148914.i5C3kW.rst [new file with mode: 0644]