summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorJakub KulĂ­k <Kulikjak@gmail.com>2019-09-13 09:25:32 (GMT)
committerJulien Palard <julien@palard.fr>2019-09-13 09:25:32 (GMT)
commit42671aea2db6cbc54369617da0fd3545048e0a45 (patch)
treebdd9e6c196e4fa852d3c3ec04dd8b1add824b797 /Lib/argparse.py
parent7183064e9e2a1b19f2ff469a65a34e7094483881 (diff)
downloadcpython-42671aea2db6cbc54369617da0fd3545048e0a45.zip
cpython-42671aea2db6cbc54369617da0fd3545048e0a45.tar.gz
cpython-42671aea2db6cbc54369617da0fd3545048e0a45.tar.bz2
bpo-37785: Fix xgettext warning in argparse (GH-15161)
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r--Lib/argparse.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 2e46e76..370692b 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -1214,8 +1214,9 @@ class FileType(object):
return open(string, self._mode, self._bufsize, self._encoding,
self._errors)
except OSError as e:
- message = _("can't open '%s': %s")
- raise ArgumentTypeError(message % (string, e))
+ args = {'filename': string, 'error': e}
+ message = _("can't open '%(filename)s': %(error)s")
+ raise ArgumentTypeError(message % args)
def __repr__(self):
args = self._mode, self._bufsize