Skip to content

[3.14] gh-88336: Fix UnicodeDecodeError with multibyte utf8 characters in ShareableList (GH-26328) - #161117

Merged
gpshead merged 1 commit into
python:3.14from
gpshead:backport-9348e13-3.14
Nov 1, 2026
Merged

gpshead merged 1 commit into
python:3.14from
gpshead:backport-9348e13-3.14

Conversation

@gpshead

@gpshead gpshead commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

…racters in ShareableList (pythonGH-26328)

* bpo-44170: Fix UnicodeDecodeError with multibyte utf8 characters in ShareableList
* Round up the allocated size instead of rejecting the exact fit

Allocating one extra alignment block for a value whose encoded size is
a multiple of the alignment made a copy of the list wider than the
original.  Round the size up instead, so that it is the same for the
same value, and keep allowing a value which fills the slot exactly:
rejecting it broke setting an 8-byte string in a slot of an integer.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <[email protected]>
(cherry picked from commit 9348e13)

Co-authored-by: Jun <[email protected]>
@gpshead
gpshead enabled auto-merge (squash) November 1, 2026 18:55
@gpshead
gpshead merged commit 5f92e38 into python:3.14 Nov 1, 2026
51 checks passed
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