-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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-121018: Fix more cases of exiting in argparse when exit_on_error=False #121056
gh-121018: Fix more cases of exiting in argparse when exit_on_error=False #121056
Conversation
serhiy-storchaka
commented
Jun 26, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false.
- Internal code now always raises ArgumentError instead of calling error(). It is then caught at higher level and error() is called if exit_on_error is true.
- Issue: argparse.ArgumentParser.parses_args does not honor exit_on_error=False when given unrecognized arguments #121018
…rror=False * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at higher level and error() is called if exit_on_error is true.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to
|
…it_on_error=False (pythonGH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true. (cherry picked from commit 81a654a) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-121128 is a backport of this pull request to the 3.13 branch. |
…it_on_error=False (pythonGH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true. (cherry picked from commit 81a654a) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-121129 is a backport of this pull request to the 3.12 branch. |
…error=False (GH-121056) (GH-121129) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true. (cherry picked from commit 81a654a)
…error=False (GH-121056) (GH-121128) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true. (cherry picked from commit 81a654a)
…rror=False (pythonGH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true.
…rror=False (pythonGH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true.
…rror=False (pythonGH-121056) * parse_intermixed_args() now raises ArgumentError instead of calling error() if exit_on_error is false. * Internal code now always raises ArgumentError instead of calling error(). It is then caught at the higher level and error() is called if exit_on_error is true.