[issue14364] Argparse incorrectly handles '--' as argument to option

2021-03-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning because I haven't been able to make time for this one. -- assignee: rhettinger -> ___ Python tracker ___

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-07 Thread hai shi
hai shi added the comment: > The PR's Misc/NEWS entry, "Fix behavior of argparse when '--' as argument to > option", is insufficient. Thanks for your comment, Raymond. I would continue update the desc. -- ___ Python tracker

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: Paul and David, is the current PR complete in your opinion? Are there known cases where the PR would break existing, working code? Also there needs to be doc entry that is clear on both new and old strategy for distinguishing options from arguments when

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-05 Thread hai shi
hai shi added the comment: Hi, Jonas. Thanks for your report. Let us wait core team's discuss;) -- ___ Python tracker ___ ___

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-03 Thread Jonas Schäfer
Jonas Schäfer added the comment: Since I have been adversely affected by this bug ([1]), I looked at the patches. I combined issue14364.test.patch (which adds test cases for --foo=--) and dbldash.patch in my local working tree and that seems to resolve the issue (tests pass if and only if I

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
Change by hai shi : -- nosy: +rhettinger type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
Change by hai shi : -- pull_requests: +15369 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15714 ___ Python tracker ___

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
hai shi added the comment: some test cases which paul provided looks doesn't keep compatible. In TestDoubleDashRemoval: # output in my env is Namespace(cmd='cmd', foo=None, rest=['--', '--foo']) ('-- cmd -- -- --foo', NS(cmd='cmd', foo=None, rest=['--', '--', '--foo'])) # output in my env is

[issue14364] Argparse incorrectly handles '--' as argument to option

2016-12-17 Thread paul j3
paul j3 added the comment: I've copied 'dbldash.patch' over from http://bugs.python.org/issue13922. I mistakenly added it to a closed issue. The patch is old, and should be revised. It is also missing tests for this '--opt=--' case, even though it solves it. I also reference this patch

[issue14364] Argparse incorrectly handles '--' as argument to option

2016-03-27 Thread paul j3
paul j3 added the comment: I made a mistake of trying to add to or refine a closed patch. Maybe I need to move the dbldash.patch over here for more formal consideration. -- ___ Python tracker

[issue14364] Argparse incorrectly handles '--' as argument to option

2016-03-27 Thread Martin Panter
Martin Panter added the comment: In Python 3.5, this does not seem fixed. Issue 13922 is marked as resolved and fixed, but Pauls’s patch has not actually been committed. >>> ap = ArgumentParser() >>> ap.add_argument("-t", "--test", type=str, nargs=1) _StoreAction(option_strings=['-t',

[issue14364] Argparse incorrectly handles '--'

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364 ___ ___

[issue14364] Argparse incorrectly handles '--'

2013-04-19 Thread paul j3
paul j3 added the comment: The patch that I recently submitted for http://bugs.python.org/issue13922 appears to solve this issue. It only removes the '--' that marked the end of options. With: parser = argparse.ArgumentParser() parser.add_argument('-f','--foo')

[issue14364] Argparse incorrectly handles '--'

2013-04-19 Thread Michele Orrù
Michele Orrù added the comment: wow, I was just writing the unittests, thanks paul. Shall I continue? I don't see any test case on tip. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364

[issue14364] Argparse incorrectly handles '--'

2013-04-19 Thread Michele Orrù
Michele Orrù added the comment: Yes, http://bugs.python.org/file29845/dbldash.patch seems to fix this. Attaching the unittests, and noisying on your issue. -- keywords: +patch Added file: http://bugs.python.org/file29938/issue14364.test.patch ___

[issue14364] Argparse incorrectly handles '--'

2013-04-18 Thread Mark Lawrence
Mark Lawrence added the comment: @Michele could you provide a patch for this? -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364 ___

[issue14364] Argparse incorrectly handles '--'

2013-04-18 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364 ___ ___ Python-bugs-list mailing list

[issue14364] Argparse incorrectly handles '--'

2012-03-24 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364 ___ ___ Python-bugs-list

[issue14364] Argparse incorrectly handles '--'

2012-03-18 Thread Michele Orrù
New submission from Michele Orrù maker...@gmail.com: http://docs.python.org/library/argparse.html#arguments-containing The attached file shows different behaviours when using '--' immediately after an optional argument. tumbolandia:cpython maker$ python foo.py --test=-- foo []

[issue14364] Argparse incorrectly handles '--'

2012-03-18 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It does look like there's anomalous behavior here of some sort, but I'd expect --test=-- to result in test=--, myself, rather than an error. My intuition is that '--' would need to be preceded by a space to function as the 'end of

[issue14364] Argparse incorrectly handles '--'

2012-03-18 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I just tried this with grep's -e and --regexp: $ cat temp.txt a--b cdef $ grep -e-- -v temp.txt cdef $ grep --regexp=-- -v temp.txt cdef $ grep -e -- -v temp.txt cdef $ grep --regexp -- -v temp.txt cdef And with diff's -I and

[issue14364] Argparse incorrectly handles '--'

2012-03-18 Thread Michele Orrù
Michele Orrù maker...@gmail.com added the comment: +1 also for me. I will try to work for a patch in the next days. :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14364 ___