-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Core} Python 3.11: Remove workaround for argparse that breaks on Python 3.11 #24109
Conversation
Fixes the crash inside of argparse when setting up subparsers as described here: Azure#23015 (comment)
Thank you for your contribution mdboom! We will review the pull request and get back to you soon. |
This patch fixes my issues on Fedora 37 + Rawhide (38) with 3.11.0rc2. 👏🏻 |
Add @jiasli for awareness |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Thanks a lot @mdboom for the contribution. Due to the heavy workload in this sprint, we will check this PR and make sure it is handled in the next sprint. |
Hi @jiasli , this problem will affect to every Microsoft Azure client using Fedora, RHEL, or Linux distro subscribed to the Python repos in the following days, as soon as they update their machines. Please, reconsider the move to the next sprint, otherwise, all of these devs will not be able to work with Azure until they find this issue, and then downgrade Python in their machines |
I am afraid this is not true. The RPM we built for RHEL has requires a fixed version of Python: Lines 636 to 645 in c24f5fc
Our Ubuntu DEB package bundles its own Python: azure-cli/scripts/release/debian/build.sh Line 32 in a3aa348
Also, even Python 3.10 is not available on RHEL yet. It usually takes long time for Linux distributions to support latest Python. Previously, it usually took us 1~2 sprints (months) to support new Python versions.
This sprint Oct 2022 (2022-11-01) will end very soon. Merging this PR without complete testing is too risky. Appreciate your understanding. |
Ok, let me rephrase it: this problem will affect to every Microsoft Azure client using Fedora,
I'm sorry, but I don't understand how 2 lines of code that were already planned for this sprint since 3 weeks ago, are suddenly compromising it. I guess it's because we're just Linux users, even if we pay for M$ Azure... |
@jacoborus I've added the patch from the PR to the long list of patches/hacks for the Fedora azure-cli package and it seems to be working okay. The tests still need work, though. |
Thanks @major |
Even though we are working on support for Fedora, the new RPMs built for RHEL 8/9 are not tested on Fedora. Azure CLI package for Fedora is mainly maintained by its community.
In Azure CLI's development process, there are far more tasks to do in order to support a new programming language version than adding 2 lines. We need to update CI/CD pipeline, thoroughly test all code path, commands and scenarios to ensure the product quality (#24494). Meanwhile, Azure DevOps pipeline doesn't have Python 3.11 available right now:
which is tracked by So we currently are unable to test our code in our CI/CD pipeline. We will surely continue when the Azure DevOps pipeline is updated to support Python 3.11. We are working very hard to make Azure CLI a great product, and we truly appreciate your kind understanding. |
I did more investigation and below are my findings. Python 3.11 updated https://docs.python.org/3.11/whatsnew/changelog.html#id50
The PR for this change is python/cpython#18605 Per Git blame,
Running this line makes In https://github.com/python/cpython/blob/v3.10.8/Lib/argparse.py#L1159 super(_SubParsersAction, self).__init__(
...
choices=self._name_parser_map, Later, in https://github.com/python/cpython/blob/v3.10.8/Lib/argparse.py#L1179 self._name_parser_map[name] = parser Before running this line: After running this line: So I am not sure why |
@@ -91,8 +92,10 @@ def load_command_table(self, command_loader): | |||
|
|||
command_verb = command_name.split()[-1] | |||
# To work around http://bugs.python.org/issue9253, we artificially add any new |
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.
I checked http://bugs.python.org/issue9253 mentioned in the comment, but didn't see how it is related to this workaround.
We can think it in another way. Since Python 3.11's |
@jiasli I'm very aware of how the development process works. And still believe that a bug that potentially can waste thousands of hours of your clients worth the time. Even more when it's a bug that was there from previous versions, Python 3.11 just unveiled it |
Just to comment that I am being affected by this error, I have a pipeline with this task (running in microsoft hosted agents):
The workaround was to change from 3.x to 3.10, so I am assuming that Python 3.11 is already supported by Microsoft and a fix is urgent. There is any other way to prioritize this fix? |
Fixes the crash inside of argparse when setting up subparsers as described here:
#23015 (comment)
Related command
All
az
commands.Description
First step on the road to Python 3.11 compatibility.
Testing Guide
In a Python 3.11 environment, run
az
(orazdev test
, though this doesn't fix all tests yet, just the vast majority).This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.