summaryrefslogtreecommitdiff
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-13 02:44:04 -0700
committerGitHub <noreply@github.com>2019-09-13 02:44:04 -0700
commitb50eff65906f8e9b4597cb0128ea1729341346fc (patch)
tree8b38f404055a277c2573edcebe6fa9594d70cf84 /Lib/argparse.py
parent6e0c066f890d66bf07c410bee6d90221a42745a8 (diff)
downloadcpython-git-b50eff65906f8e9b4597cb0128ea1729341346fc.tar.gz
bpo-37785: Fix xgettext warning in argparse (GH-15161)
(cherry picked from commit 42671aea2db6cbc54369617da0fd3545048e0a45) Co-authored-by: Jakub KulĂ­k <Kulikjak@gmail.com>
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 24af355b74..35d77a88a2 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -1207,8 +1207,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