-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-85427: Prevent exits if ArgumentParser.exit_on_error
is False
#30832
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-85427: Prevent exits if ArgumentParser.exit_on_error
is False
#30832
Conversation
Looking inside |
There are other calls to |
I found a duplicate with some more discussion: bpo-41255. From the penultimate comment:
|
ArgumentParser.exit_on_error
is FalseArgumentParser.exit_on_error
is False
ArgumentParser.exit_on_error
is FalseArgumentParser.exit_on_error
is False
Alternative to #27295 |
Backref to #85427 (@jacobtylerwalls please could you update the title to start with gh-85427?). A |
ArgumentParser.exit_on_error
is FalseArgumentParser.exit_on_error
is False
@JelleZijlstra Forgive the ping! I just I noticed a duplicate issue (#103498) and PR (#103519) rolled in for this. Do you have a reviewer you might recommend to take a look? Where we left off was comparing 1.) guarding the calls to
I was somewhat convinced by the comment quoted in #30832 (comment). Plus it's more backwards compatible to leave |
@sobolevn and @barneygale expressed some interest in argparse issues recently. I don't feel strongly here but I'll try to find some time to read up again and form an opinion. |
Also closes: #103498 |
Thank you for your contribution @jacobtylerwalls. I apologize for the fact that this PR was neglected for a long time. The problem has already been solved in a way similar to the way proposed in your PR. |
bpo-41255
The
exit_on_error
docs read:From this, I agree with the reporter that all exit paths should raise an exception rather than exit.
https://bugs.python.org/issue46440
Fixes #85427