From cdf88a71216c06848b7f26767c1077a21d7eeb2b Mon Sep 17 00:00:00 2001 From: Wanderingss <1624155937@qq.com> Date: Thu, 29 Oct 2026 16:39:58 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20run=5Fboot=5Ftest=20=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=B2=E5=BC=95=E5=8F=B7=E6=94=B9=E4=B8=AD=E6=96=87=E5=BC=95?= =?UTF-8?q?=E5=8F=B7=E2=80=94=E2=80=94=E4=BB=A3=E4=B8=BA=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BB=96=E4=BA=BA=E5=9C=A8=E9=A3=9E=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同样是本会话开始前就在工作区的未提交改动(非本次编辑),按用户指示代为提交。 内容逐字节未变:在飞时与工作区的 git hash-object = 369380ca8eb024b593d872455b6a020797abcd8d, 本笔提交里的 blob 同一个(本会话早些时候核对过两次,值一致)。 改动性质:_split_cmd() 的 docstring 里两处示例路径的 ASCII 单/双引号换成中文引号, 共 2 行、全在 docstring 内,函数行为不变(仍 shlex.split(posix=False) 后逐段剥引号)。 动机与 AGENTS「字符串字面量必须纯 ASCII」同源:中文语境里的 ASCII 引号容易被误当 代码边界(这条陷阱在本仓的 shell 混用历史里反复出现)。 核验:.venv 解释器 python -m py_compile 通过;git diff 仅 4 行、无逻辑行改动; no-mojibake / trailing-whitespace 无问题(同样因全局 exclude 挡掉,手工跑过)。 --- .dsh/skills/serial-boot-test/scripts/run_boot_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.dsh/skills/serial-boot-test/scripts/run_boot_test.py b/.dsh/skills/serial-boot-test/scripts/run_boot_test.py index c626c1bb..369380ca 100644 --- a/.dsh/skills/serial-boot-test/scripts/run_boot_test.py +++ b/.dsh/skills/serial-boot-test/scripts/run_boot_test.py @@ -140,8 +140,8 @@ def _split_cmd(cmd_str): 直接交给 subprocess、**不经 `cmd /c`**:CreateProcess 能直接跑 .bat,且 Python 会给含空格的路径正确加引号。旧写法 `['cmd','/c', 串]` 在本仓库(目录名 `DTU Code` 含空格)会被 cmd 的 /c 引号规则玩坏——实测报 - `'D:\Code\DTU' is not recognized`,回读校验被假判成"芯片内容不一致"。 - 路径本身含空格时把该段用引号包住(`"D:\some dir\flash_tool.bat" flash`)。 + 「'D:\Code\DTU' is not recognized」,回读校验被假判成"芯片内容不一致"。 + 路径本身含空格时把该段用引号包住(「"D:\some dir\flash_tool.bat" flash」)。 posix=False 是必须的:posix=True 会吃掉 Windows 路径里的反斜杠。 """ return [p.strip('"') for p in shlex.split(cmd_str, posix=False)]