Title: argparse uses %s in gettext calls causing xgettext warnings
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: CuriousLearner, bethard, eric.araujo, kulikjak, paul.j3
Priority: normal Keywords: patch

Created on 2019-08-07 12:49 by kulikjak, last changed 2019-08-12 10:26 by xtreak.

Pull Requests
URL Status Linked Edit
PR 15161 open kulikjak, 2019-08-07 12:53
Messages (4)
msg349166 - (view) Author: Jakub Kulik (kulikjak) * Date: 2019-08-07 12:49
Running xgettext on (of any currently supported Python 3.x) return following warning:

./Lib/ 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: 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).
msg349305 - (view) Author: Sanyam Khurana (CuriousLearner) * (Python triager) Date: 2019-08-09 18:09
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.
msg349445 - (view) Author: Jakub Kulik (kulikjak) * Date: 2019-08-12 08:16

I see; this is not a change for security only stage. I merged your suggestion.
msg349449 - (view) Author: Sanyam Khurana (CuriousLearner) * (Python triager) Date: 2019-08-12 08:55
Hi Eric,

This is with reference to

I've looked at the PR and it's ready for a core-review:

Can you please take a look at this?

Many thanks!
Date User Action Args
2019-08-12 10:26:02xtreaksetnosy: + paul.j3
2019-08-12 08:55:55CuriousLearnersetnosy: + bethard, eric.araujo
messages: + msg349449
2019-08-12 08:16:05kulikjaksetmessages: + msg349445
2019-08-09 18:09:02CuriousLearnersetversions: - Python 3.5, Python 3.6
nosy: + CuriousLearner

messages: + msg349305

type: behavior
2019-08-07 12:53:02kulikjaksetkeywords: + patch
stage: patch review
pull_requests: + pull_request14894
2019-08-07 12:51:34kulikjaksettitle: argparse uses %s in gettext calls -> argparse uses %s in gettext calls causing xgettext warnings
2019-08-07 12:49:16kulikjakcreate