Message243447
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"])) |
|
Date |
User |
Action |
Args |
2015-05-18 01:22:12 | bobjalex | set | recipients:
+ bobjalex |
2015-05-18 01:22:12 | bobjalex | set | messageid: <1431912132.53.0.00377060178324.issue24223@psf.upfronthosting.co.za> |
2015-05-18 01:22:12 | bobjalex | link | issue24223 messages |
2015-05-18 01:22:11 | bobjalex | create | |
|