Skip to content

Python 3.14: batch module argument loading fails due to typing/union handling in _command_type.py #33284

@YangAn-microsoft

Description

@YangAn-microsoft

Summary

Doc generation fails on Python 3.14 when running ExportCommands.py.

Environment

  • Repo: Azure/azure-cli
  • OS: Windows
  • Python (failing): 3.14.4
  • Python (working): 3.13.13

Repro steps

  1. Activate env314.
  2. Ensure PYTHONPATH includes local knack checkout.
  3. Run:
    python ExportCommands.py ./doc

Actual result

The run fails during command argument loading with:

AttributeError: module 'azure.batch.models' has no attribute 'bool | None'

Trace location includes:

  • azure-cli/src/azure-cli/azure/cli/command_modules/batch/_command_type.py:838
  • azure-cli/src/azure-cli/azure/cli/command_modules/batch/_command_type.py:41

Expected result

Doc generation completes successfully.

Comparison

  • Python 3.13.13: succeeds (Export finished, help files generated)
  • Python 3.14.4: fails with the error above

Additional output seen in failing run

  • Error loading command module acs: deadlock detected by _ModuleLock('requests.structures')
  • Error loading command module containerapp: deadlock detected by _ModuleLock('requests.structures')

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions