Skip to content

SyntaxWarning: invalid escape sequence '\ ' warning in azure SDKΒ #30440

@upasnagandhi0

Description

@upasnagandhi0

Describe the bug

After recent upgrade to version 2.67.0, I started receiving a SyntaxWarning on the first run of Python scripts. I ran command to access the password from KeyVault, which triggers the CI/CD pipeline for iOS Certificate.

Related command

az keyvault secret show --name <secret-name> --vault-name <keyvault-name>

Errors

/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/keyvault/v2023_02_01/models/_models_py3.py:4230: SyntaxWarning: invalid escape sequence '\ '
  """Properties of the vault.
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/keyvault/v2023_02_01/models/_models_py3.py:4349: SyntaxWarning: invalid escape sequence '\ '

Issue script & Debug output

cli.knack.cli: Command arguments: ['keyvault', 'secret', 'show', '--name', 'xyz', '--vault-name', 'xyz', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1033f8040>, <function OutputProducer.on_global_arguments at 0x1035d0a40>, <function CLIQuery.on_global_arguments at 0x1035de2a0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'keyvault': ['azure.cli.command_modules.keyvault']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: keyvault 0.018 20 113
cli.azure.cli.core: Total (1) 0.018 20 113
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 20 groups, 113 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : keyvault secret show
cli.azure.cli.core: Command table: keyvault secret show
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x10550cfe0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/root/.azure/commands/2024-11-28.12-15-22.keyvault_secret_show.31958.log'.
az_command_data_logger: command args: keyvault secret show --name {} --vault-name {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x1057927a0>]
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/keyvault/v2023_02_01/models/_models_py3.py:4230: SyntaxWarning: invalid escape sequence '\ '
"""Properties of the vault.
/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/lib/python3.12/site-packages/azure/mgmt/keyvault/v2023_02_01/models/_models_py3.py:4349: SyntaxWarning: invalid escape sequence '\ '
"""
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []

Expected behavior

To retrieve the password from KeyVault without warnings, allowing the pipeline to extract it on the first run.

Environment Summary

azure-cli 2.67.0

core 2.67.0
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.67.0/libexec/bin/python'
Extensions directory '/Users/upasna.gandhi/.azure/cliextensions'

Python (Darwin) 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamKeyVaultaz keyvaultOKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions