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, bethard, paul.j3
Date 2018-02-14.11:22:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518607375.33.0.467229070634.issue32756@psf.upfronthosting.co.za>
In-reply-to
Content
I am adding one more testcase in order to clarify more the problem:



import argparse
import sys

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



$ python argparse_test.py -ab
Namespace(a=True, b=True, c=False)
[]


Expected result:
$ python argparse_test.py -ab -cd
Namespace(a=True, b=True, c=True)
['-d']

Actual result:
$ python argparse_test.py -ab -cd
usage: argparse_test.py [-a] [-b] [-c]
argparse_test.py: error: argument -c: ignored explicit argument 'd'
History
Date User Action Args
2018-02-14 11:22:55actionlesssetrecipients: + actionless, bethard, paul.j3
2018-02-14 11:22:55actionlesssetmessageid: <1518607375.33.0.467229070634.issue32756@psf.upfronthosting.co.za>
2018-02-14 11:22:55actionlesslinkissue32756 messages
2018-02-14 11:22:55actionlesscreate