-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-38821: Fix crash in argparse when using gettext #17192
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
gettext deprecated non-integer arguments for ngettext in bpo-28692
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). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Thanks for your time, and welcome to CPython @federicobond! I assume that you've seen the bot's message about the CLA? |
Hi there @brandtbucher, yes. Waiting for the CLA to get accepted! Should I include a changelog in the PR? |
Yes please! You can do so easily here. |
Done! I was not feeling particularly inspired writing the news entry, so feel free to suggest changes. |
Please add a test. |
I could not find any existing test exercising locale support in argparse. What would this test assert? |
I suggest testing various possible values for nargs, including all of the special ones, when using gettext. |
I think adding those tests would be a great idea but none of them would fail prior to this change, so I am not sure we should bundle them together. A proper regression test for this change needs to load a custom catalog, bind it to the global domain, etc. |
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.
Just a bit of clarification on the NEWS entry:
Misc/NEWS.d/next/Library/2019-11-16-23-26-25.bpo-38821.-albNN.rst
Outdated
Show resolved
Hide resolved
We could also monkey-patch That being said, this PR is an obvious fix and we apparently have no existing tests for the use of |
Co-Authored-By: Brandt Bucher <[email protected]>
@taleinat sure, I can do that. Do you think those tests should accompany this PR or should I open a new one? I would rather submit another PR so we can discuss them separately and not stall this changeset, but whatever works best for the maintainers is good for me too. |
@federicobond, yes, let's go with a separate issue and PR for adding such tests. |
Misc/NEWS.d/next/Library/2019-11-16-23-26-25.bpo-38821.-albNN.rst
Outdated
Show resolved
Hide resolved
Co-Authored-By: Tal Einat <[email protected]>
Thanks @federicobond for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
I'm having trouble backporting to |
(cherry picked from commit be5c79e) Co-authored-by: Federico Bond <[email protected]>
GH-17288 is a backport of this pull request to the 3.7 branch. |
Thanks @federicobond for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit be5c79e) Co-authored-by: Federico Bond <[email protected]>
GH-17289 is a backport of this pull request to the 3.8 branch. |
(cherry picked from commit be5c79e) Co-authored-by: Federico Bond <[email protected]>
(cherry picked from commit be5c79e) Co-authored-by: Federico Bond <[email protected]>
Congrats on your first CPython contribution @federicobond! 🍾 Looking forward to seeing more from you in the future. |
Thank you @brandtbucher & co! I can see that you have all put a lot of effort into making this a pleasurable experience, definitely makes me want to contribute again 🎉 |
https://bugs.python.org/issue38821