Uh oh!
There was an error while loading. Please reload this page.
gh-85427: Prevent exits if ArgumentParser.exit_on_error is False - #30832
gh-85427: Prevent exits if ArgumentParser.exit_on_error is False#30832jacobtylerwalls wants to merge 8 commits into
ArgumentParser.exit_on_error is False#30832Conversation
JelleZijlstra
commented
Jan 24, 2022
Looking inside |
JelleZijlstra
commented
Jan 24, 2022
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 FalseArgumentParser.exit_on_error is FalseArgumentParser.exit_on_error is Falsejacobtylerwalls
commented
Feb 5, 2022
Alternative to #27295 |
AA-Turner
commented
Jun 7, 2022
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 |
JelleZijlstra
commented
Apr 15, 2023
@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. |
sobolevn
commented
Apr 15, 2023
Also closes: #103498 |
sobolevn
commented
Apr 15, 2023
serhiy-storchaka
commented
Jun 28, 2024
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_errordocs 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