-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-134970: Fix exception message in argparse
module
#134971
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-134970: Fix exception message in argparse
module
#134971
Conversation
Fix the "unknown action" exception in `argparse.ArgumentParser.add_argument_group()` to correctly replace the action class.
Loosen the argparse exception check to fix tests with Python 3.14. Starting with Python 3.14, the exception is supposed to use single quotes rather than double quotes. However, due to python/cpython#134971 it currently does not include the name at all -- an easy way to get compatibility for both quoting variants and to work around the bug is to not check the name at all. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Loosen the argparse exception check to fix tests with Python 3.14. Starting with Python 3.14, the exception is supposed to use single quotes rather than double quotes. However, due to python/cpython#134971 it currently does not include the name at all -- an easy way to get compatibility for both quoting variants and to work around the bug is to not check the name at all. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Loosen the argparse exception check to fix tests with Python 3.14. Starting with Python 3.14, the exception is supposed to use single quotes rather than double quotes. However, due to python/cpython#134971 it currently does not include the name at all -- an easy way to get compatibility for both quoting variants and to work around the bug is to not check the name at all. Signed-off-by: Michał Górny <mgorny@gentoo.org> Part-of: #105 Closes: #105 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch, thanks for this!
@ZeroIntensity I think this just needs a backport to 3.14, since this was something @serhiy-storchaka updated for alpha 2. |
Thanks @mgorny for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, @mgorny and @serhiy-storchaka, I could not cleanly backport this to
|
GH-134991 is a backport of this pull request to the 3.14 branch. |
Thanks, missed that. |
Fix the "unknown action" exception in
argparse.ArgumentParser.add_argument_group()
to correctly replace the action class.