Skip to content
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

gh-81691: Fix handling of multiple "--" (double dashes) in argparse #124233

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 19, 2024

Only the first one has now been removed, all subsequent ones are now taken literally.

@savannahostrowski
Copy link
Member

Thanks for putting up the PR. I was going back through a couple of other bugs in argparse related to the handling of --, and I think that nargs=argparse.REMAINDER still isn't going to behave correctly here (I pulled down the branch and the repro cases in #66419 still don't work as expected).

I know that REMAINDER was made undocumented via #61252, but I think we'd probably still want to update this as well?

@serhiy-storchaka
Copy link
Member Author

Yes, but changing this behavior requires more significant rewriting. I am planning to do this later.

@serhiy-storchaka serhiy-storchaka changed the title gh-95468: Fix handling of multiple "--" (double dashes) in argparse gh-81691: Fix handling of multiple "--" (double dashes) in argparse Sep 19, 2024
…arse

Only the first one has now been removed, all subsequent ones are now
taken literally.
@serhiy-storchaka serhiy-storchaka merged commit aae1267 into python:main Sep 20, 2024
34 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the argparse-double-dash branch September 20, 2024 06:20
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 20, 2024
…arse (pythonGH-124233)

Only the first one has now been removed, all subsequent ones are now
taken literally.
(cherry picked from commit aae1267)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 20, 2024

GH-124266 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 20, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 20, 2024
…arse (pythonGH-124233)

Only the first one has now been removed, all subsequent ones are now
taken literally.
(cherry picked from commit aae1267)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 20, 2024

GH-124267 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 20, 2024
serhiy-storchaka added a commit that referenced this pull request Sep 20, 2024
…parse (GH-124233) (GH-124267)

Only the first one has now been removed, all subsequent ones are now
taken literally.
(cherry picked from commit aae1267)

Co-authored-by: Serhiy Storchaka <[email protected]>
savannahostrowski pushed a commit to savannahostrowski/cpython that referenced this pull request Sep 22, 2024
…arse (pythonGH-124233)

Only the first one has now been removed, all subsequent ones are now
taken literally.
savannahostrowski pushed a commit to savannahostrowski/cpython that referenced this pull request Sep 22, 2024
…arse (pythonGH-124233)

Only the first one has now been removed, all subsequent ones are now
taken literally.
serhiy-storchaka added a commit that referenced this pull request Oct 7, 2024
…parse (GH-124233) (GH-124266)

Only the first one has now been removed, all subsequent ones are now
taken literally.
(cherry picked from commit aae1267)

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants