New submission from Bob Alexander:

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"]))

----------
components: Library (Lib)
messages: 243447
nosy: bobjalex
priority: normal
severity: normal
status: open
title: argparse parsing bug
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24223>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to