-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
argparse
subparser defaults in Python 3.9+
#2210
Comments
This is great analysis and extremely helpful! I saw (from https://bugs.python.org/issue45235) that the maintainer @rhettinger and @ambv have decided to roll back this change . |
Indeed, that's why I'm letting #2211 and #2212 sit in limbo for now. If the change upstream is reverted, we don't need to scramble to release a patch. If this behavior change is still going to happen in a future Python version (I hope in 3.11 or 3.12, since 3.10 is already theoretically "stable" since last month), we will at least have time to plan for it and transition gracefully instead of being blindsided by sudden CI failures like this. @jiasli I appreciate you opening the Azure CLI issue that ultimately got Guido's attention, too. 😸 |
For our own tracking purposes: The patch to revert this change is awaiting merge and backporting. python/cpython#29525 |
Revert merged to 3.11/main branch. Backports incoming; 3.9 is python/cpython#29531 |
Backport now merged to 3.9 and 3.10 branches. |
Python 3.9.9 released today, including the patch that reverts this change. I haven't found a way to poke the Actions team directly for an update, but will look harder when I have some more time. Maybe I'll send a support ticket or Community thread, if that's all I can see. actions/python-versions doesn't accept issues, and it looks like PRs are supposed to be created via automation. |
I will check tomorrow (technically today, but only because timezones are silly) if all is well by triggering some rebuilds for open, failing PRs. Python 3.9.9 should be available to our jobs now that it's released for use by actions/setup-python. actions/runner-images#4521 says it should be baked into images (presumably any that use 3.9 by default) next week. |
Rollout appears to be finished, and our Python 3.9 jobs are passing again. I will remove this issue from the 7.1.7 release milestone, but leave it open pending activity on python/cpython#29574, an alternative solution to the original problem that bpo-45235 was trying to solve. |
Unpinned the issue. There's been no significant activity in the linked issue/PR(s) since my last comment here, and the reason for pinning (Sopel being broken on a current stable Python release) was solved months ago. |
Still no hints of this demon coming back to bite us any time soon. Let's close the issue, trusting our future selves to search for |
Python seems to be making some changes to
argparse
's handling of subparser defaults.(All above verified via in-browser Ctrl-F for 'argparse' in the respective changelogs. The relevant patch is listed under the "Library" subheader.)
Our CI failures all come from numerous jobs in Sopel's
test_cli_run.py
suite, where in every case I looked at, the "custom" value passed in to validate the correct behavior is overridden by the option's default value. For example:Only two commits touched CPython's
Lib/argparse.py
after the tag date for 3.9.7, one of which appears to be irrelevant (it messes with some help stuff). That leaves python/cpython@a18d522, a backport of the patch for bpo-45235.The text was updated successfully, but these errors were encountered: