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 bobjalex
Recipients bobjalex
Date 2015-05-18.01:22:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431912132.53.0.00377060178324.issue24223@psf.upfronthosting.co.za>
In-reply-to
Content
Here is simple example of failure to parse arguments that should parse OK. In the following little program, the second from last line contains an aargument sequence that parses OK, but the last line should but doesn't.

import argparse
ap = argparse.ArgumentParser()
ap.add_argument("--option", action="store_true")
ap.add_argument("arg_1")
ap.add_argument("arg_2", nargs="?")
print("test 1:", ap.parse_args(["abc", "mmm", "--option"]))
print("test 2:", ap.parse_args(["abc", "--option", "mmm"]))
History
Date User Action Args
2015-05-18 01:22:12bobjalexsetrecipients: + bobjalex
2015-05-18 01:22:12bobjalexsetmessageid: <1431912132.53.0.00377060178324.issue24223@psf.upfronthosting.co.za>
2015-05-18 01:22:12bobjalexlinkissue24223 messages
2015-05-18 01:22:11bobjalexcreate