jenkins-core-weekly: update to 2.491
[oi-userland.git] / components / python / python37 / patches / 12-argparse-xgettext.patch
blobcf736c98390831b595517d35042450b54fcc9d3d
1 Fix argparse.py causing warnings when passed to xgettext.
3 This patch was already pushed to upstream and will is part of Python 3.8 and later.
4 https://github.com/python/cpython/pull/16080/
5 https://bugs.python.org/issue37785/
7 --- Python-3.7.5/Lib/argparse.py
8 +++ Python-3.7.5/Lib/argparse.py
9 @@ -1207,8 +1207,9 @@ class FileType(object):
10 return open(string, self._mode, self._bufsize, self._encoding,
11 self._errors)
12 except OSError as e:
13 - message = _("can't open '%s': %s")
14 - raise ArgumentTypeError(message % (string, e))
15 + args = {'filename': string, 'error': e}
16 + message = _("can't open '%(filename)s': %(error)s")
17 + raise ArgumentTypeError(message % args)
19 def __repr__(self):
20 args = self._mode, self._bufsize