Title: optparse uses %s in gettext calls
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
Status: closed Resolution: rejected
Dependencies: 4391 Superseder:
Assigned To: eric.araujo Nosy List: BreamoreBoy, eric.araujo, georg.brandl, gward, r.david.murray
Priority: normal Keywords: patch

Created on 2010-12-23 23:59 by eric.araujo, last changed 2014-09-27 21:43 by r.david.murray. This issue is now closed.

File name Uploaded Description Edit
fix-gettext-positionals.diff eric.araujo, 2010-12-23 23:59
Messages (7)
msg124578 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-23 23:59
When you run xgettext other, you get this 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.”

Attached patch fixes the incorrect calls (my patch for #4391 already fixes two of them).

See similar bug and fix for argparse in #10528.  Georg, please tell if this can go into 3.2.
msg124774 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-28 09:38
Hmm, argparse is new, so that is a different story.  Not so sure about optparse, so I would not put this into 3.2.
msg124817 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-28 21:05
argparse is not new if you consider that it’s present in 2.7.
msg189045 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2013-05-12 16:36
I don't understand this.  Fixes have already been committed via #4391 but this fix couldn't go ahead.  Can somebody please clarify the situation.
msg189584 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-05-19 12:51
The #4391 fixes were only applied to the development branch.  So these could be applied to 3.4 at this point, but not 3.3.
msg222382 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-07-05 23:56
I don't see much point doing any work with optparse as it's deprecated.
msg227736 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-27 21:43
OK, since there seems to be some concern about backward compatibility (in the related argparse issue) and optparse is indeed no longer maintained, let's close this.
Date User Action Args
2014-09-27 21:43:25r.david.murraysetstatus: open -> closed
resolution: rejected
messages: + msg227736

stage: commit review -> resolved
2014-07-05 23:56:54BreamoreBoysetnosy: + BreamoreBoy
messages: + msg222382
2014-02-03 18:30:57BreamoreBoysetnosy: - BreamoreBoy
2013-05-19 12:51:31r.david.murraysetstatus: open
versions: + Python 3.4, - Python 3.3
nosy: + r.david.murray

messages: + msg189584
2013-05-12 16:36:37BreamoreBoysetnosy: + BreamoreBoy
messages: + msg189045
2011-05-26 16:43:07eric.araujosetstatus: open -> (no value)
versions: + Python 3.3, - Python 3.2
2010-12-28 21:05:09eric.araujosetmessages: + msg124817
2010-12-28 09:38:37georg.brandlsetmessages: + msg124774
2010-12-23 23:59:22eric.araujosetdependencies: + use proper gettext plurals forms in argparse and optparse
2010-12-23 23:59:08eric.araujocreate