rescue: 断电事故后工作区全量备份

This commit is contained in:
2026-09-24 15:59:44 +08:00
parent 8a196d6c87
commit 08a9b962b4
204 changed files with 77921 additions and 77173 deletions
+2 -1
View File
@@ -262,7 +262,8 @@ def _shell_meta() -> dict:
if not vf.is_file():
return {}
try:
d = json.loads(vf.read_text(encoding="utf-8"))
# utf-8-sig:防 version.json 带 UTF-8 BOM(否则 json.loads 抛 JSONDecodeError → 回退失败)
d = json.loads(vf.read_text(encoding="utf-8-sig"))
return d if isinstance(d, dict) else {}
except Exception: # noqa: BLE001
return {}