SyntaxWarning: Invalid escape sequence \/ in `azure-mgmt-resource-deploymentstacks` 1.0.0

未关闭 适合新手
#50,155 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
cloud

调研方向

警告来自 azure/mgmt/resource/deploymentstacks/models/_models.py 第 119 行的 docstring,其中在斜杠前有一个未转义的反斜杠。复现时,开启警告后导入该包(例如 python -W error -c "import azure.mgmt.resource.deploymentstacks")。完成标准是导入时不再输出 SyntaxWarning。该文件是生成的,因此需要检查修复是否应放在生成器输出中,而不是文件本身。

由索引模型根据 Issue 内容生成。

描述

needs-triage
  • Package Name: azure-mgmt-resource-deploymentstacks
  • Package Version: 1.0.0
  • Operating System: macOS-27.0.1-arm64-arm-64bit-Mach-O
  • Python Version: 3.14.8

Describe the bug
https://github.com/Azure/azure-cli/issues/34237

The package emits a SyntaxWarning due to an invalid escape sequence \/ in the generated model file.

Warning message:

azure/mgmt/resource/deploymentstacks/models/_models.py:119:
SyntaxWarning: "\/" is an invalid escape sequence.
Such sequences will not work in the future.
Did you mean "\\/"? A raw string is also an option.

The warning originates from an unescaped backslash in a docstring in _models.py.

To Reproduce

Steps to reproduce the behavior:

  1. Install the package:
    pip install azure-mgmt-resource-deploymentstacks==1.0.0
    
  2. Import the package:
    from azure.mgmt.resource.deploymentstacks import DeploymentStacksClient
    
  3. Observe the SyntaxWarning emitted during import.

Expected behavior

The package should not emit any SyntaxWarning during import.

The invalid escape sequence should be properly escaped (\\) or the affected docstring should use a raw string.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

主要语言
Python
星标
5.6k
派生
3.4k
平均合并
1 天 22 小时
30 天内合并 PR
189

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/azure-sdk-for-python 的其他 Issue

查看 Azure/azure-sdk-for-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。