Uh oh!
There was an error while loading. Please reload this page.
gh-103498: argparse.ArgumentParser will always throw instead of exit if exit_on_error=False - #103519
gh-103498: argparse.ArgumentParser will always throw instead of exit if exit_on_error=False#103519JustBeYou wants to merge 2 commits into
Conversation
bedevere-bot
commented
Apr 13, 2023
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
ec4f0b7 to
1b3c821Compare… exit if exit_on_error=False
olgarithms
commented
Apr 24, 2023
@sobolevn , do you think this is a good fix? I can add tests to this :) |
JustBeYou
commented
May 4, 2023
Taking a closer look at the problem, I don't see the proposed fix as suitable anymore. I think that to properly solve the problem with |
serhiy-storchaka
commented
Jun 28, 2024
Thank you for your contribution @JustBeYou. I apologize for the fact that this PR was neglected for a long time. The problem has already been solved in another way. |
Fix for #103498
Summary:
ArgumentParser.errormethod based onexit_on_errorparameterraise ArgumentErrorwithself.error()inArgumentParserArgumentParser.error, namelyaction=Nonebecause raisingArgumentErrorrequires itNote:
ArgumentParser; a solution to this would be to use**kwargsinstead, but seems kind of dirty to me. suggestions appreciated