-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-143164: Fix incorrect error message for ctypes bitfield overflow #143165
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The previous message did not match the actual overflow check and omitted the bitfield size, making it misleading. Update the message to reflect the correct condition and report all relevant values. Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
|
Maybe we can add a test to check the message to ensure that we don't break it up in the future? |
Thanks for the review! The test case has now been added. |
Co-authored-by: AN Long <aisk@users.noreply.github.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
I have a suggestion for test example.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the message should be updated too.
Updated, thanks for the feedback. |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for misleading. I meant the error message tested in the test should be updated. Otherwise the test will fail.
|
Oh, sorry for my mistake. Updated it. |
|
Thanks @hyongtao-code for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…flow (pythonGH-143165) (cherry picked from commit b9a4806) Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com> Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
|
Sorry, @hyongtao-code and @serhiy-storchaka, I could not cleanly backport this to |
|
GH-143176 is a backport of this pull request to the 3.14 branch. |
The previous message did not match the actual overflow check and omitted the bitfield size, making it misleading. Update the message to reflect the correct condition and report all relevant values.