Author n8falke
Recipients n8falke
Date 2019-02-22.14:18:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550845114.74.0.376208054151.issue36078@roundup.psfhosted.org>
In-reply-to
Content
Example source:
from argparse import ArgumentParser, SUPPRESS
==============
parser = ArgumentParser()
parser.add_argument('i', nargs='?', type=int, default=SUPPRESS)
args = parser.parse_args([])
==============
results in:
error: argument integer: invalid int value: '==SUPPRESS=='

Expected: args = Namespace()


In Lib/argparse.py:
line 2399 in _get_value: result = type_func(arg_string)
with arg_string = SUPPRESS = '==SUPPRESS=='

called by ... line 1836 in take_action: argument_values = self._get_values(action, argument_strings)
which is done before checking for SUPPRESS in line 1851:
    if argument_values is not SUPPRESS:
       action(...)
History
Date User Action Args
2019-02-22 14:18:34n8falkesetrecipients: + n8falke
2019-02-22 14:18:34n8falkesetmessageid: <1550845114.74.0.376208054151.issue36078@roundup.psfhosted.org>
2019-02-22 14:18:34n8falkelinkissue36078 messages
2019-02-22 14:18:34n8falkecreate