[issue37510] argparse removing more "--" than it should

2019-07-07 Thread paul j3
paul j3 added the comment: https://bugs.python.org/file29845/dbldash.patch while written against an earlier version of `argparse`, does what you want. I moved the '--' removal out of `_get_values` and into `consume_positionals`. Note that a full patch should include test cases and

[issue37510] argparse removing more "--" than it should

2019-07-06 Thread Jorge L. Martinez
Jorge L. Martinez added the comment: Maybe I can find the time to make a patch this weekend (either today or tomorrow). I hope I'm not underestimating this somehow, but I don't think this would take too long. The only issue I can foresee is in disagreement of what the correct behavior

[issue37510] argparse removing more "--" than it should

2019-07-06 Thread paul j3
paul j3 added the comment: I looked at this issue way back, in 2013: https://bugs.python.org/issue13922 I probably shouldn't have tacked this on to a closed issue. -- ___ Python tracker

[issue37510] argparse removing more "--" than it should

2019-07-06 Thread Jorge L. Martinez
Jorge L. Martinez added the comment: > to remove the "--" present in arg_strings *to remove the first "--" present... -- ___ Python tracker ___

[issue37510] argparse removing more "--" than it should

2019-07-06 Thread Jorge L. Martinez
Jorge L. Martinez added the comment: > There are earlier bug/issues about the '--'. Yes, there are: https://bugs.python.org/issue9571 https://bugs.python.org/issue3 https://bugs.python.org/issue14364 But this one seems separate. Though they're related, they don't seem like duplicates,

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread paul j3
paul j3 added the comment: There are earlier bug/issues about the '--'. Also look at the parser code itself. Keep in mind that parsing is done in two passes - once to identify flags versus arguments ('O/A') and then to allocate strings to arguments. I don't recall when '--' is being

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread Jorge L. Martinez
Jorge L. Martinez added the comment: To be clear, my opinion is that a single call of parse_args() should only ever remove the first "--". Right now, it seems that it removes the first of each argument group, as determined by nargs, I guess. --

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread Jorge L. Martinez
Jorge L. Martinez added the comment: Sorry, I forgot to add details on my machine. Python: 3.7.3 OS: Archlinux -- ___ Python tracker ___

[issue37510] argparse removing more "--" than it should

2019-07-05 Thread Jorge L. Martinez
New submission from Jorge L. Martinez : $ 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)) '