-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Argparse logs incorrect ambiguous option #125254
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
Comments
cc @savannahostrowski, you've been working on argparse recently, right? |
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Oct 10, 2024
This was a regression introduced in pythongh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line.
Thank you for your report @clavedeluna. This was a regression introduced in #58573. |
serhiy-storchaka
added a commit
that referenced
this issue
Oct 12, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 12, 2024
…ythonGH-125273) This was a regression introduced in pythongh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line. (cherry picked from commit 63cf4e9) Co-authored-by: Serhiy Storchaka <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 12, 2024
…ythonGH-125273) This was a regression introduced in pythongh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line. (cherry picked from commit 63cf4e9) Co-authored-by: Serhiy Storchaka <[email protected]>
This was referenced Oct 12, 2024
serhiy-storchaka
added a commit
that referenced
this issue
Oct 12, 2024
…GH-125273) (GH-125360) This was a regression introduced in gh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line. (cherry picked from commit 63cf4e9) Co-authored-by: Serhiy Storchaka <[email protected]>
serhiy-storchaka
added a commit
that referenced
this issue
Oct 12, 2024
…GH-125273) (GH-125359) This was a regression introduced in gh-58573. It was only tested for the case when the ambiguous option is the last argument in the command line. (cherry picked from commit 63cf4e9) Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
Given this example script
Notice the cli args are
name-exclude
andname-include
Run the following command, which incorrectly puts the arg as
--name
python argparse_mini.py /some/path --output here.txt --name something --path-exclude *request.py
If you run it with Python 3.12.2 or below, the resulting log statement is what we expect
argparse_mini.py: error: ambiguous option: --name could match --name-exclude, --name-include
However, tested with 3.12.7 and the log statement instead is
argparse_mini.py: error: ambiguous option: *request.py could match --name-exclude, --name-include
which is clearly incorrect, as
*request.py
was the argument to a different CLI optionCPython versions tested on:
3.11, 3.12
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: