-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-130928: Fix error message during bytes formatting for the 'i' flag #130967
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
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 I'd add a unit test for this.
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.
Yes, please, add a unit test :)
And also a NEWS entry. This is a user-visible change.
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.
Thanks, I think that the fix is correct.
But, let's wait for @serhiy-storchaka review, because his is the code owner.
You can also add yourself to https://github.com/python/cpython/blob/main/Misc/ACKS |
Co-authored-by: sobolevn <[email protected]>
Thanks, but I've already taken advantage of that opportunity earlier |
I would also suggest to create a new issue to add tests for |
@serhiy-storchaka friendly ping, what do you think? :) |
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 that test_common_format
in test_format.py
may be a better place for the tests. There are already tests for %d
and %x
. You can just add
test_exc_common('%i', '1', TypeError,
"%i format: a real number is required, not str")
Or you can leave tests in both places.
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.
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.
Thanks again!
We usually do not backport error message changes. |
Error output before correction:
Error output after correction: