fix: 统一路径分隔符为正斜杠,修复 macOS/Linux 兼容性
all_keys.json 中的 key 统一使用 `/` 作为路径分隔符, 消除 Windows 反斜杠硬编码,确保跨平台兼容。 涉及文件: find_all_keys.py, decrypt_db.py, monitor.py, monitor_web.py, mcp_server.py, decode_image.py, latency_test.py Fixes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -129,7 +129,7 @@ def main():
|
||||
for f in files:
|
||||
if f.endswith('.db') and not f.endswith('-wal') and not f.endswith('-shm'):
|
||||
path = os.path.join(root, f)
|
||||
rel = os.path.relpath(path, DB_DIR)
|
||||
rel = os.path.relpath(path, DB_DIR).replace('\\', '/')
|
||||
sz = os.path.getsize(path)
|
||||
db_files.append((rel, path, sz))
|
||||
|
||||
@@ -142,8 +142,8 @@ def main():
|
||||
total_bytes = 0
|
||||
|
||||
for rel, path, sz in db_files:
|
||||
# 用反斜杠格式查找key (json中的key是Windows路径)
|
||||
rel_key = rel.replace('/', '\\')
|
||||
# 统一用正斜杠查找key
|
||||
rel_key = rel.replace('\\', '/')
|
||||
if rel_key not in keys:
|
||||
print(f"SKIP: {rel} (无密钥)")
|
||||
failed += 1
|
||||
|
||||
Reference in New Issue
Block a user