Skip to content

fix: resolve SyntaxWarning invalid escape sequence in azure-mgmt-compute models#47102

Open
dcaayushd wants to merge 1 commit into
Azure:mainfrom
dcaayushd:fix/mgmt-compute-invalid-escape-sequence
Open

fix: resolve SyntaxWarning invalid escape sequence in azure-mgmt-compute models#47102
dcaayushd wants to merge 1 commit into
Azure:mainfrom
dcaayushd:fix/mgmt-compute-invalid-escape-sequence

Conversation

@dcaayushd
Copy link
Copy Markdown

@dcaayushd dcaayushd commented May 24, 2026

Fixes #47011

Python 3.12 raises SyntaxWarning: invalid escape sequence '\W' when importing
several Azure mgmt packages because docstrings contain [\W_] — a regex pattern
with an unescaped backslash in a regular string.

Fixed by replacing [\W_] with [\\W_] in 10 occurrences across 7 generated
model files:

  • sdk/compute/azure-mgmt-compute
  • sdk/computebulkactions/azure-mgmt-computebulkactions
  • sdk/computefleet/azure-mgmt-computefleet
  • sdk/containerservice/azure-mgmt-containerservice
  • sdk/workloads/azure-mgmt-workloads
  • sdk/workloads/azure-mgmt-workloadssapvirtualinstance

All SDK Contribution checklist:

  • The pull request does not introduce breaking changes
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

Copilot AI review requested due to automatic review settings May 24, 2026 11:15
@github-actions github-actions Bot added the Community Contribution Community members are working on the issue label May 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution @dcaayushd! We will review the pull request and get back to you soon.

@github-actions github-actions Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates password complexity documentation strings across multiple Azure SDK model packages to properly escape the regex character class [\W_] in Python string literals.

Changes:

  • Escape \W as \\W in password complexity docs to avoid invalid escape sequences while preserving the intended rendered text.
  • Apply the same documentation fix consistently across multiple generated model files/packages.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/models/_models.py Escapes \W in password regex doc text for OSProfile.
sdk/workloads/azure-mgmt-workloads/azure/mgmt/workloads/models/_models_py3.py Escapes \W in reST/:code: formatted password regex doc text for OSProfile (docstring and init).
sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models.py Escapes \W in ManagedClusterWindowsProfile password regex doc text.
sdk/computefleet/azure-mgmt-computefleet/azure/mgmt/computefleet/models/_models.py Escapes \W in VirtualMachineScaleSetOSProfile password regex doc text.
sdk/computebulkactions/azure-mgmt-computebulkactions/azure/mgmt/computebulkactions/models/_models.py Escapes \W in OSProfile password regex doc text.
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/models/_models.py Escapes \W in several OSProfile-related password regex doc texts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntax warnings when using azure-mgmt-compute in Python 3.12

2 participants