Skip to content
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

bpo-44865: Missing translations in argparse #27668

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

jdetrey
Copy link
Contributor

@jdetrey jdetrey commented Aug 8, 2021

A couple of other missing translations are addressed by #12711.

Incidentally, this also fixes a bug with the "(default: …)" help string of the BooleanOptionalAction class: when used with the ArgumentDefaultsHelpFormatter, a second "(default: …)" string would be added to the help text. This was due to the fact that the default value was immediately expanded in the help string, and thus wasn't detected as a "(default: …)" string by the ArgumentDefaultsHelpFormatter._get_help_string() method (which relies on finding a named format argument %(default) inside the help string).

https://bugs.python.org/issue44865

A couple of other missing translations are addressed by python#12711.

Incidentally, this also fixes a bug with the "(default: …)" help
string of the `BooleanOptionalAction` class: when used with the
`ArgumentDefaultsHelpFormatter`, a second "(default: …)" string
would be added to the help text. This was due to the fact that
the `default` value was immediately expanded in the help string,
and thus wasn't detected as a "(default: …)" string by the
`ArgumentDefaultsHelpFormatter._get_help_string()` method
(which relies on finding a named format argument `%(default)`
inside the help string).
@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Sep 24, 2021
Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All argparse tests ok.

@jdetrey jdetrey mannequin mentioned this pull request Apr 10, 2022
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Aug 11, 2022
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks reasonable. Please resolve conflicts with the main branch.

If this fixes a bug, there should be tests.

@bedevere-app
Copy link

bedevere-app bot commented Feb 26, 2024

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@jdetrey
Copy link
Contributor Author

jdetrey commented Feb 26, 2024

Hello and thanks for the feedback!

I have made the requested changes; please review again.

Some of the changes from the original PR were not necessary anymore:

All in all, a single change remains from the original PR :)
I hope it'll still be useful. Thank you very much, in any case!

Kind regards,
Jérémie.

@serhiy-storchaka
Copy link
Member

Thank you for your contribution. For this PR and #12711. I apologize that it took a long time to review it.

@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes needs backport to 3.12 bug and security fixes labels Feb 26, 2024
@jdetrey
Copy link
Contributor Author

jdetrey commented Feb 26, 2024

No worries at all, @serhiy-storchaka! Thanks a lot for reviewing it and for the merge! :)

@serhiy-storchaka serhiy-storchaka merged commit 6087315 into python:main Feb 26, 2024
34 of 35 checks passed
@miss-islington-app
Copy link

Thanks @jdetrey for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 26, 2024
@bedevere-app
Copy link

bedevere-app bot commented Feb 26, 2024

GH-115974 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Feb 26, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 26, 2024
@bedevere-app
Copy link

bedevere-app bot commented Feb 26, 2024

GH-115975 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Feb 26, 2024
@jdetrey jdetrey deleted the fix-44865 branch February 26, 2024 22:06
serhiy-storchaka pushed a commit that referenced this pull request Feb 26, 2024
) (GH-115974)

(cherry picked from commit 6087315)

Co-authored-by: Jérémie Detrey <[email protected]>
serhiy-storchaka pushed a commit that referenced this pull request Feb 26, 2024
) (GH-115975)

(cherry picked from commit 6087315)

Co-authored-by: Jérémie Detrey <[email protected]>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants