regex warnings in MsftLinuxPatchCore.py?
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
从 MsftLinuxPatchCore.py 的第 7451、7468 和 7476 行开始,然后在 Ubuntu 24.04 Azure VM 上重现该问题,同时观察扩展日志。验证受影响的 regex 处理在 LinuxPatchExtension 启动期间不再发出无效转义序列警告。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I see the following in my journalctl logs:
Aug 22 00:36:41 sr-monitor systemd[1]: Starting MsftLinuxPatchAutoAssess.service - Microsoft Azure Linux Patch Extension - Auto Assessment...
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7451: SyntaxWarning: invalid escape sequence '\_'
Aug 22 00:36:41 sr-monitor bash[143561]: """ Fetches pid from the error message by searching for the text 'pid' and returns the process tree with all details.
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7468: SyntaxWarning: invalid escape sequence '\d'
Aug 22 00:36:41 sr-monitor bash[143561]: regex = re.compile(' pid \d+')
Aug 22 00:36:41 sr-monitor bash[143561]: /var/lib/waagent/Microsoft.CPlat.Core.LinuxPatchExtension-1.6.62/MsftLinuxPatchCore.py:7476: SyntaxWarning: invalid escape sequence '\d'
Aug 22 00:36:41 sr-monitor bash[143561]: regex = re.compile('\d+')
Is this a bug?
To Reproduce
Steps to reproduce the behavior:
- Create Azure Ubuntu VM
- Enable LinuxPatchExtension
- Watch the logs
Expected behavior
No regex warnings
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: ubuntu
- Browser N/A
- Version 24_04-lts
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
- 主要语言
- Python
- 星标
- 12
- 派生
- 20
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/LinuxPatchExtension 的其他 Issue
-
难度 2/5 半天 新手友好度 68/100
Azure/LinuxPatchExtension#350 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
Azure/LinuxPatchExtension#381 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
Azure/LinuxPatchExtension#369 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 52/100
Azure/LinuxPatchExtension#339 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 55/100
Azure/LinuxPatchExtension#337 · 1 条评论 ·
查看 Azure/LinuxPatchExtension 的全部 Issue
相似的 Issue
-
documentation help wanted
难度 2/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 90/100
simonw/sqlite-utils#872 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100