gh-143164: Fix incorrect error message for ctypes bitfield overflow#143165
gh-143164: Fix incorrect error message for ctypes bitfield overflow#143165serhiy-storchaka merged 7 commits intopython:mainfrom
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.
LGTM. 👍
I have a suggestion for test example.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.
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. |
|
It seems 3.13 does not have such message. |
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.