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 <>
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_2", nargs="?")
print("test 1:", ap.parse_args(["abc", "mmm", "--option"]))
print("test 2:", ap.parse_args(["abc", "--option", "mmm"]))
Date User Action Args
2015-05-18 01:22:12bobjalexsetrecipients: + bobjalex
2015-05-18 01:22:12bobjalexsetmessageid: <>
2015-05-18 01:22:12bobjalexlinkissue24223 messages
2015-05-18 01:22:11bobjalexcreate