]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] 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 09:30:16 +0000 (11:30 +0200)
committerGitHub <noreply@github.com>
Sat, 2 May 2026 09:30:16 +0000 (09:30 +0000)
commit4f8399f317d3a982d3fcfebfd57b87b3c7de9845
tree0738d515651e8bd55eebd8c096d01743a94b98ed
parent96705609e8b9098c3a5a8fd3cbdf2b13a1ba1dfd
[3.14] gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation (GH-149052) (GH-149274)

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]