[New-bugs-announce] [issue37510] argparse removing more "--" than it should

Jorge L. Martinez report at bugs.python.org
Fri Jul 5 16:45:30 EDT 2019


New submission from Jorge L. Martinez <jol at fastmail.com>:

$ python -c '
import argparse
p = argparse.ArgumentParser()
p.add_argument("first_arg")
p.add_argument("args", nargs="*")
r = p.parse_args(["foo", "--", "bar", "--", "baz", "--", "zap"])
print(r.first_arg + " " + " ".join(r.args))
'                        

returns:

foo bar baz -- zap

when I think it should return:

foo bar -- baz -- zap

----------
components: Library (Lib)
messages: 347378
nosy: jol
priority: normal
severity: normal
status: open
title: argparse removing more "--" than it should
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37510>
_______________________________________


More information about the New-bugs-announce mailing list