]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert "bpo-37785: Fix xgettext warning in argparse (GH-15161)" (GH-16082)
authorJulien Palard <julien@palard.fr>
Fri, 13 Sep 2019 10:20:14 +0000 (12:20 +0200)
committerGitHub <noreply@github.com>
Fri, 13 Sep 2019 10:20:14 +0000 (12:20 +0200)
This reverts commit b50eff65906f8e9b4597cb0128ea1729341346fc because
it's an incompatible change that would have broken the existing
translations.

Lib/argparse.py
Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst [deleted file]

index 35d77a88a247343f6fea84eac51bdbe085481fac..24af355b74413018540ee3093cc02aad484d3999 100644 (file)
@@ -1207,9 +1207,8 @@ class FileType(object):
             return open(string, self._mode, self._bufsize, self._encoding,
                         self._errors)
         except OSError as e:
-            args = {'filename': string, 'error': e}
-            message = _("can't open '%(filename)s': %(error)s")
-            raise ArgumentTypeError(message % args)
+            message = _("can't open '%s': %s")
+            raise ArgumentTypeError(message % (string, e))
 
     def __repr__(self):
         args = self._mode, self._bufsize
diff --git a/Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst b/Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst
deleted file mode 100644 (file)
index 2d3aa4f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Fix xgettext warnings in :mod:`argparse`.