From 850e0283d6c02cfcdca7fb2c6b2dc02cdd68a2e3 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 10 Feb 2025 20:03:37 +0800 Subject: [PATCH] fix --- test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index def2911..7f8fdff 100644 --- a/test.py +++ b/test.py @@ -210,7 +210,7 @@ class comicInfo: # 创建临时文件处理覆盖操作 with NamedTemporaryFile(delete=False) as tmp: tmp.close() - shutil.copy(cbz_path, tmp.name) + shutil.move(cbz_path, tmp.name) # 读取原文件并替换 ComicInfo.xml with ZipFile(tmp.name, 'r') as source_zip: @@ -228,7 +228,7 @@ class comicInfo: except Exception as e: print(f"更新 CBZ 文件失败: {e}") if os.path.exists(tmp.name): - os.replace(tmp.name, cbz_path) # 恢复备份 + shutil.move(tmp.name, cbz_path) # 恢复备份 return False def update_comicinfo_cbz(self, cbz_path):