[Python-checkins] r86985 - in python/branches/py3k: Lib/argparse.py Misc/NEWS

eric.araujo python-checkins at python.org
Fri Dec 3 20:19:18 CET 2010


Author: eric.araujo
Date: Fri Dec  3 20:19:17 2010
New Revision: 86985

Log:
Fix incorrect use of gettext in argparse (#10497).

Steven, the maintainer of argparse, agreed to have this committed
without tests for now, since the fix is obvious.  See the bug log.


Modified:
   python/branches/py3k/Lib/argparse.py
   python/branches/py3k/Misc/NEWS

Modified: python/branches/py3k/Lib/argparse.py
==============================================================================
--- python/branches/py3k/Lib/argparse.py	(original)
+++ python/branches/py3k/Lib/argparse.py	Fri Dec  3 20:19:17 2010
@@ -1080,7 +1080,7 @@
             parser = self._name_parser_map[parser_name]
         except KeyError:
             tup = parser_name, ', '.join(self._name_parser_map)
-            msg = _('unknown parser %r (choices: %s)' % tup)
+            msg = _('unknown parser %r (choices: %s)') % tup
             raise ArgumentError(self, msg)
 
         # parse all the remaining options into the namespace
@@ -1121,7 +1121,7 @@
             elif 'w' in self._mode:
                 return _sys.stdout
             else:
-                msg = _('argument "-" with mode %r' % self._mode)
+                msg = _('argument "-" with mode %r') % self._mode
                 raise ValueError(msg)
 
         # all other arguments are used as file names

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Fri Dec  3 20:19:17 2010
@@ -35,6 +35,8 @@
 Library
 -------
 
+- Issue #10497: Fix incorrect use of gettext in argparse.
+
 - Issue #10478: Reentrant calls inside buffered IO objects (for example by
   way of a signal handler) now raise a RuntimeError instead of freezing the
   current process.


More information about the Python-checkins mailing list