Skip to content

[3.15] gh-154566: Fix array.byteswap() corrupting 'Zd' arrays with more than one element (GH-154567) - #155756

Merged
hugovk merged 1 commit into
python:3.15from
miss-islington:backport-46c355f-3.15
Aug 14, 2026
Merged

[3.15] gh-154566: Fix array.byteswap() corrupting 'Zd' arrays with more than one element (GH-154567)#155756
hugovk merged 1 commit into
python:3.15from
miss-islington:backport-46c355f-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fix array.array.byteswap() corrupting data for 'Zd' (complex
double) arrays with more than one element: the 16-byte item loop advanced
the buffer pointer by only 8 bytes per iteration, causing items after the
first to be scrambled.
(cherry picked from commit 46c355f)

Co-authored-by: PhysicistJohn 54456354+PhysicistJohn@users.noreply.github.com
Co-authored-by: Victor Stinner vstinner@python.org

…e than one element (pythonGH-154567)

Fix array.array.byteswap() corrupting data for 'Zd' (complex
double) arrays with more than one element: the 16-byte item loop advanced
the buffer pointer by only 8 bytes per iteration, causing items after the
first to be scrambled.
(cherry picked from commit 46c355f)

Co-authored-by: PhysicistJohn <54456354+PhysicistJohn@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hugovk
hugovk merged commit 71cb165 into python:3.15 Aug 14, 2026
60 checks passed
@miss-islington
miss-islington deleted the backport-46c355f-3.15 branch August 14, 2026 08:54
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.

4 participants