8000 bpo-37785: Fix xgettext warning in argparse (GH-15161) · python/cpython@b50eff6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b50eff6

Browse files
bpo-37785: Fix xgettext warning in argparse (GH-15161)
(cherry picked from commit 42671ae) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
1 parent 6e0c066 commit b50eff6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/argparse.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,9 @@ def __call__(self, string):
12071207
return open(string, self._mode, self._bufsize, self._encoding,
12081208
self._errors)
12091209
except OSError as e:
1210-
message = _("can't open '%s': %s")
1211-
raise ArgumentTypeError(message % (string, e))
1210+
args = {'filename': string, 'error': e}
1211+
message = _("can't open '%(filename)s': %(error)s")
1212+
raise ArgumentTypeError(message % args)
12121213

12131214
def __repr__(self):
12141215
args = self._mode, self._bufsize
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix xgettext warnings in :mod:`argparse`.

0 commit comments

Comments
 (0)
0