summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Palard <julien@palard.fr>2019-09-13 10:20:14 (GMT)
committerGitHub <noreply@github.com>2019-09-13 10:20:14 (GMT)
commitf14fcbf2995b43c8607a1448402633ac558a745f (patch)
treef75b5437bdad6292b58c04da011de7ec277518bc
parentb50eff65906f8e9b4597cb0128ea1729341346fc (diff)
downloadcpython-f14fcbf2995b43c8607a1448402633ac558a745f.zip
cpython-f14fcbf2995b43c8607a1448402633ac558a745f.tar.gz
cpython-f14fcbf2995b43c8607a1448402633ac558a745f.tar.bz2
Revert "bpo-37785: Fix xgettext warning in argparse (GH-15161)" (GH-16082)
This reverts commit b50eff65906f8e9b4597cb0128ea1729341346fc because it's an incompatible change that would have broken the existing translations.
-rw-r--r--Lib/argparse.py5
-rw-r--r--Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst1
2 files changed, 2 insertions, 4 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 35d77a8..24af355 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -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
index 2d3aa4f..0000000
--- a/Misc/NEWS.d/next/Library/2019-08-07-14-49-22.bpo-37785.y7OlT8.rst
+++ /dev/null
@@ -1 +0,0 @@
-Fix xgettext warnings in :mod:`argparse`.