Skip to content

[3.14] gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation (GH-149052)#149274

Merged
serhiy-storchaka merged 1 commit intopython:3.14from
miss-islington:backport-b897356-3.14
May 2, 2026
Merged

[3.14] gh-148914: Fix memoization of in-band PickleBuffer in the Python implementation (GH-149052)#149274
serhiy-storchaka merged 1 commit intopython:3.14from
miss-islington:backport-b897356-3.14

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented May 2, 2026

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 b897356)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…n implementation (pythonGH-149052)

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 b897356)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka merged commit 4f8399f into python:3.14 May 2, 2026
50 checks passed
@miss-islington miss-islington deleted the backport-b897356-3.14 branch May 2, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants