Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-143904: Raise OverflowError instead of IndexError for too large offset in struct.pack_into()#143905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedJan 16, 2026
edited by bedevere-appbot
Loading


buffer: Py_buffer(accept={rwbuffer})
offset as offset_obj: object
offset: Py_ssize_t
Copy link
Member

Choose a reason for hiding this comment

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

This long-time behavior, I think we need a deprecation.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This behavior is uncommon, it was not documented and not covered by tests, it should not occur in normal code. This looks like a long-time bug, we just do not backport its fix.

It is not easy to deprecate a raised exception, and deprecation will have effect comparable with simple changing the exception type. We usually do not do this.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

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

LGTM. It seems safe and reasonable to raise a different exception for this corner case.

@serhiy-storchakaserhiy-storchaka merged commit1834741 intopython:mainFeb 1, 2026
53 checks passed
@serhiy-storchakaserhiy-storchaka deleted the struct-pack_into-offset-overflow-error branchFebruary 1, 2026 13:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@skirpichevskirpichevskirpichev left review comments

@vstinnervstinnervstinner approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@vstinner@skirpichev

[8]ページ先頭

©2009-2026 Movatter.jp