-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
argparse fails to get value of argument if the value is --
#109475
Comments
|
Hello @kushal-kumaran I try to run it on my device I get some output I hope that will help |
I completely disagree with this. Imagine if you were reading the documentation of a command line utility, and it said "If you want the output file to be named '--', then use 'doubledash' instead, and this will be translated to '--' internally. It is not possible to specify an output name of 'doubledash'." I think this is a completely valid bug report. I'm not sure it's fixable, given all of the issues with argparse and how it scans arguments. I am surprised that using |
For example "--option=--".
…114814) For example "--option=--".
pythonGH-114814) For example "--option=--". (cherry picked from commit 4aa4f09) Co-authored-by: Serhiy Storchaka <[email protected]>
…argparse (pythonGH-114814) For example "--option=--". (cherry picked from commit 4aa4f09) Co-authored-by: Serhiy Storchaka <[email protected]>
…se (GH-114814) (GH-115036) For example "--option=--". (cherry picked from commit 4aa4f09) Co-authored-by: Serhiy Storchaka <[email protected]>
pythonGH-114814) For example "--option=--".
Bug report
Bug description:
This code:
prints:
The value of the
--broken
argument is not parsed, presumably because it is the standard end-of-argument-list value. But this does not seem expected when the value is introduced with=
. Besides, in this case, the parsing does continue for subsequent args, so it was not actually treated as end of arguments.CPython versions tested on:
3.11, 3.12
Operating systems tested on:
Linux
Linked PRs
--
#110959The text was updated successfully, but these errors were encountered: