Bug 2125364

Summary: azure-cli broken with Python 3.11 in Fedora 37/rawhide
Product: [Fedora] Fedora Reporter: Major Hayden 🤠 <mhayden>
Component: azure-cliAssignee: Major Hayden 🤠 <mhayden>
Status: CLOSED ERRATA QA Contact: Major Hayden 🤠 <mhayden>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: hello, mhayden, python-sig, rhavenn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: azure-cli-2.40.0-2.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-10 22:11:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Major Hayden 🤠 2022-09-08 18:07:09 UTC
azure-cli does not function with Python 3.11 in rawhide/F38:

# az help
The command failed with an unexpected error. Here is the traceback:
argument _subcommand: conflicting subparser: check-name
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 565, in execute
    self.parser.load_command_table(self.commands_loader)
  File "/usr/lib/python3.11/site-packages/azure/cli/core/parser.py", line 100, in load_command_table
    command_parser = subparser.add_parser(command_verb,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/argparse.py", line 1185, in add_parser
    raise ArgumentError(self, _('conflicting subparser: %s') % name)
argparse.ArgumentError: argument _subcommand: conflicting subparser: check-name
To open an issue, please run: 'az feedback'

Bug opened upstream: https://github.com/Azure/azure-cli/issues/23015

Upstream has decided to work on 3.11 support *after* 3.11 is GA. 😢

Comment 1 rhavenn 2022-09-23 19:16:52 UTC
Can confirm it also doesn't work on F37beta release.

Comment 2 Major Hayden 🤠 2022-09-23 20:48:58 UTC
Yup. Upstream hasn't made any moves about Python 3.11 yet. 😢

Comment 3 Major Hayden 🤠 2022-10-05 15:54:36 UTC
Patch was proposed here: https://github.com/Azure/azure-cli/issues/23015#issuecomment-1268587028

Trying this out in COPR: https://copr.fedorainfracloud.org/coprs/mhayden/azure-cli/builds/

Comment 4 Major Hayden 🤠 2022-10-05 17:44:47 UTC
Looks good on a few test machines running F37. The tests are still a mess and they don't fully support Python 3.11 yet, so I am leaving them disabled. This change will at least get azure-cli hobbling along on F37/F38 while upstream finishes Python 3.11 support.

Comment 5 Fedora Update System 2022-10-05 17:47:22 UTC
FEDORA-2022-e149166e20 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e149166e20

Comment 6 Fedora Update System 2022-10-06 14:17:23 UTC
FEDORA-2022-e149166e20 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-e149166e20`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-e149166e20

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2022-11-10 22:11:11 UTC
FEDORA-2022-e149166e20 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.