You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
argparse uses %s in gettext calls causing xgettext warnings #81966
3.7 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
Running xgettext on argparse.py (of any currently supported Python 3.x) return following warning:
./Lib/argparse.py: warning: 'msgid' format string with unnamed arguments cannot be properly localized: The translator cannot reorder the arguments. Please consider using a format string with named arguments, and a mapping instead of a tuple for the arguments.
Same problem was already partially fixed here: https://bugs.python.org/issue10528. I guess that this occurrence was either missed or is new since.
It would be nice to have this backported to all supported releases but considering incompatibility worries in issue linked above, it may be fixed only in 3.8+ (which is still nice).
3.7 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
Activity
kulikjak commentedon Aug 7, 2019
Running xgettext on argparse.py (of any currently supported Python 3.x) return following warning:
./Lib/argparse.py: warning: 'msgid' format string with unnamed arguments cannot be properly localized: The translator cannot reorder the arguments. Please consider using a format string with named arguments, and a mapping instead of a tuple for the arguments.
Same problem was already partially fixed here: https://bugs.python.org/issue10528. I guess that this occurrence was either missed or is new since.
It would be nice to have this backported to all supported releases but considering incompatibility worries in issue linked above, it may be fixed only in 3.8+ (which is still nice).
[-]argparse uses %s in gettext calls[/-][+]argparse uses %s in gettext calls causing xgettext warnings[/+]CuriousLearner commentedon Aug 9, 2019
Hi Jakub,
Welcome and thank you for contributing. I've added a suggestion on your pull request.
Python 3.6 and Python 3.5 are in security fixes stage, so I've removed those tags from this bug.
kulikjak commentedon Aug 12, 2019
Thanks,
I see; this is not a change for security only stage. I merged your suggestion.
CuriousLearner commentedon Aug 12, 2019
Hi Eric,
This is with reference to https://bugs.python.org/issue10528.
I've looked at the PR and it's ready for a core-review: #15161
Can you please take a look at this?
Many thanks!
JulienPalard commentedon Sep 13, 2019
New changeset 42671ae by Julien Palard (Jakub Kulík) in branch 'master':
bpo-37785: Fix xgettext warning in argparse (GH-15161)
42671ae
serhiy-storchaka commentedon Sep 13, 2019
It is a backward incompatible change. It will break existing translations. It should not be backported.
miss-islington commentedon Sep 13, 2019
New changeset b50eff6 by Miss Islington (bot) in branch '3.7':
bpo-37785: Fix xgettext warning in argparse (GH-15161)
b50eff6
miss-islington commentedon Sep 13, 2019
New changeset 8750dfe by Miss Islington (bot) in branch '3.8':
bpo-37785: Fix xgettext warning in argparse (GH-15161)
8750dfe
serhiy-storchaka commentedon Sep 13, 2019
I think it would be safer to revert changes in maintained versions. At least in 3.7.
JulienPalard commentedon Sep 13, 2019
OK to revert in 3.7, got your point.
JulienPalard commentedon Sep 13, 2019
Thanks for noticing Serhiy!
JulienPalard commentedon Sep 13, 2019
New changeset f14fcbf by Julien Palard in branch '3.7':
Revert "bpo-37785: Fix xgettext warning in argparse (GH-15161)" (GH-16082)
f14fcbf