This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author actionless
Recipients actionless
Date 2018-02-03.12:31:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517661104.06.0.467229070634.issue32756@psf.upfronthosting.co.za>
In-reply-to
Content
steps to reproduce:

    import argparse
    import sys
    
    parser = argparse.ArgumentParser(prog=sys.argv[0], add_help=False)
    parser.add_argument('-a', action='store_true')
    parsed_args, unknown_args = parser.parse_known_args(sys.argv[1:])
    print(parsed_args)
    print(unknown_args)


Expected result:

$ python arparse_test.py -ab
Namespace(a=True)
['b']


Actual result:

$ python arparse_test.py -ab
usage: arparse_test.py [-a]
arparse_test.py: error: argument -a: ignored explicit argument 'b'
History
Date User Action Args
2018-02-03 12:31:44actionlesssetrecipients: + actionless
2018-02-03 12:31:44actionlesssetmessageid: <1517661104.06.0.467229070634.issue32756@psf.upfronthosting.co.za>
2018-02-03 12:31:44actionlesslinkissue32756 messages
2018-02-03 12:31:43actionlesscreate