Skip to content

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

Open
miss-islington wants to merge 1 commit into
python:3.15from
miss-islington:backport-46c355f-3.15
Open

[3.15] gh-154566: Fix array.byteswap() corrupting 'Zd' arrays with more than one element (GH-154567)#155756
miss-islington wants to merge 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants