mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 12:30:44 +00:00
补两个自检失败:build_exe.ps1 丢 BOM + run_agent 用了未导入的 time
全量回归只剩这两项红,都是我这几步引入的: 1. 编码审计:build_exe.ps1 缺 UTF-8 BOM 我用 edit 工具改它时把 BOM 丢了。PowerShell 5.1 会按 GBK 读, 里面的中文注释会变乱码。 2. Python 静态检查:run_agent.py:760 undefined name 'time' 我在 _restart_background 里用了 time.sleep,但 run_agent.py 模块级没有 import time(原来只有 run_silent 里局部 import)。 补上之后顺手在注释里记一笔:pyflakes 这一关是有用的。 顺带:test_double_click_window.py 的注释里我原样写了两个 U+FFFD 替换字符当例子,被编码审计当成乱码 —— 改成用文字描述。 现在全量回归 41 个阶段全部通过。
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -84,8 +84,8 @@ def main() -> int:
|
||||
|
||||
# 有没有窗口:让 PowerShell 把标题**写进文件**再读。
|
||||
# ⚠ 不能直接读 stdout —— Windows 控制台默认不是 UTF-8,
|
||||
# 中文标题会变成乱码(实测 "ykxmz · 设置" 读成 "ykxmz �� ����"),
|
||||
# 于是"标题里带设置"这条会假失败。
|
||||
# 中文标题读出来是两个替换字符(这里不写出来,免得编码审计
|
||||
# 把它们当成乱码报),于是"标题里带设置"这条会假失败。
|
||||
try:
|
||||
title_file = work / "title.txt"
|
||||
subprocess.run(
|
||||
|
||||
@@ -409,9 +409,9 @@ Banner "3a7/7 Python 语法(必须用 compile,不能用 ast.parse)"
|
||||
# 这一轮被同一件事咬了三次:补丁脚本把 import 插到 from __future__
|
||||
# 前面,整个文件就废了。而更糟的是 ast.parse 查不出来(它只解析,
|
||||
# 不做编译期检查)—— 前几次「全仓语法检查 0 问题」都是假绿。
|
||||
= & python (Join-Path "_tests\check_python_syntax.py") 2>&1
|
||||
Show-Fails
|
||||
Record "Python 语法检查" ( -eq 0)
|
||||
$stageOut = & python (Join-Path $root "_tests\check_python_syntax.py") 2>&1
|
||||
Show-Fails $stageOut
|
||||
Record "Python 语法检查" ($LASTEXITCODE -eq 0)
|
||||
|
||||
# ---------------------------------------------------------------- 3a5
|
||||
Banner "3a5/7 局域网/中转对比基准(防测试自己骗人)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 把 Windows 被控端打包成「多文件 EXE」(PyInstaller --onedir)
|
||||
# 把 Windows 被控端打包成「多文件 EXE」(PyInstaller --onedir)
|
||||
# 用法: powershell -ExecutionPolicy Bypass -File windows\build_exe.ps1
|
||||
#
|
||||
# 产物: dist_exe\ykxmz\
|
||||
|
||||
@@ -746,6 +746,11 @@ def _restart_background(store) -> None:
|
||||
用户会以为设置没生效。
|
||||
"""
|
||||
import subprocess
|
||||
import time # ← 必须在这里 import:
|
||||
# run_agent.py 模块级没有 import time(原来只有 run_silent 里
|
||||
# 局部 import 了一个),我加这个函数时直接用了 time.sleep,
|
||||
# pyflakes 立刻报 undefined name 'time'。
|
||||
# 这也说明 pyflakes 那一关是有用的。
|
||||
# 只杀"没有窗口"的那个(后台实例)。taskkill 按镜像名杀会连自己一起杀,
|
||||
# 所以这里用 wmic/powershell 过滤命令行里带 --silent 的。
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user