-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
bpo-41681: Fix for f-string/str.format error description when using 2 , in format specifier
#22036
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
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
pablogsal
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.
Thanks for the PR, @millefalcon. Could you sign up the CLA? After that you should add a test and a NEWS entry using blurb.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@pablogsal I just signed the CLA :) |
The test should be added in |
Sure. Let me add that. Thanks :) |
|
@pablogsal I added the tests for |
These two tests are enough! Thanks for the quick response :) |
pablogsal
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.
This looks good to me, but I would like a review from @ericvsmith if possible
|
@pablogsal @ammaraskar Thank you for the guidance. You both have been very helpful :) |
ericvsmith
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 don't see a test for the original error message that was reported on bpo: Cannot specify both ',' and '_'. Can you add a test for that? We need to make sure we're not breaking that.
My comment about the regex is really a nit. I'm sure that that problem exists in a lot of places in the code.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
No problem. Thank you. |
|
Thanks @millefalcon for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
|
GH-22041 is a backport of this pull request to the 3.9 branch. |
… 2 `,` in format specifier (pythonGH-22036) * Fixed `f-string/str.format` error description when using two `,` in format specifier. Co-authored-by: millefalcon <[email protected]> (cherry picked from commit 0d6aa7f) Co-authored-by: han-solo <[email protected]>
|
Sorry, @millefalcon and @ericvsmith, I could not cleanly backport this to |
|
@ericvsmith There seems to be a mistake in the tests. Two tests are same . Sorry :( |
|
That's my fault for not noticing. You can open another PR for that. I don't think it needs an issue. |
… 2 `,` in format specifier (GH-22036) (GH-22041) * Fixed `f-string/str.format` error description when using two `,` in format specifier. Co-authored-by: millefalcon <[email protected]> (cherry picked from commit 0d6aa7f) Co-authored-by: han-solo <[email protected]> Co-authored-by: han-solo <[email protected]>
|
Also, I haven't had time (and probably won't have time) to look at the backport to 3.8 failure. |
|
Sure. Sorry for not being careful enough. |
|
|
|
|
|
…pythonGH-22059) (cherry picked from commit 749ed85) Co-authored-by: han-solo <[email protected]>
…2059) (GH-22060) (cherry picked from commit 749ed85) Co-authored-by: han-solo <[email protected]> Co-authored-by: han-solo <[email protected]>
… 2 `,` in format specifier (pythonGH-22036) * Fixed `f-string/str.format` error description when using two `,` in format specifier. Co-authored-by: millefalcon <[email protected]>
@ammaraskar
Fixed the f-string/str.format error description being wrong by
adding a check to see if the previous token is an underscore character:
https://bugs.python.org/issue41681
Automerge-Triggered-By: @ericvsmith