rescue: 断电事故后工作区全量备份
This commit is contained in:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user