Skip to content

gh-145743: Fix inconsistency after calling Struct.__init__() with invalid format#145744

Merged
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:struct-reinitialization-consistency
Mar 10, 2026
Merged

gh-145743: Fix inconsistency after calling Struct.__init__() with invalid format#145744
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:struct-reinitialization-consistency

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 10, 2026

Only set the format attribute after successful (re-)initialization.

…th invalid format

Only set the format attribute after successful (re-)initialization.
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix!

@vstinner vstinner changed the title gh-145743: Fix inconsistancy after calling Struct.__init__() with invalid format gh-145743: Fix inconsistency after calling Struct.__init__() with invalid format Mar 10, 2026
Co-authored-by: Victor Stinner <vstinner@python.org>
@serhiy-storchaka serhiy-storchaka merged commit 3f33bf8 into python:main Mar 10, 2026
48 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the struct-reinitialization-consistency branch March 10, 2026 16:29
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2026
…th invalid format (pythonGH-145744)

Only set the format attribute after successful (re-)initialization.
(cherry picked from commit 3f33bf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 10, 2026
…th invalid format (pythonGH-145744)

Only set the format attribute after successful (re-)initialization.
(cherry picked from commit 3f33bf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Mar 10, 2026

GH-145763 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Mar 10, 2026
@bedevere-app
Copy link

bedevere-app bot commented Mar 10, 2026

GH-145764 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 10, 2026
serhiy-storchaka added a commit that referenced this pull request Mar 10, 2026
…ith invalid format (GH-145744) (GH-145764)

Only set the format attribute after successful (re-)initialization.
(cherry picked from commit 3f33bf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Mar 10, 2026
…ith invalid format (GH-145744) (GH-145763)

Only set the format attribute after successful (re-)initialization.
(cherry picked from commit 3f33bf8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.

2 participants