From f268cc7a31535dea6c593bb26683191e59090a24 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Thu, 14 Nov 2024 23:58:22 +0800 Subject: [PATCH] fix --- Comics/_utils/utils.py | 4 ++-- Comics/pipelines.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Comics/_utils/utils.py b/Comics/_utils/utils.py index b9c2e5d..f5adce9 100644 --- a/Comics/_utils/utils.py +++ b/Comics/_utils/utils.py @@ -508,7 +508,7 @@ class CBZUtils: logging.info(f"打包完成:{target_file}") if int(count_files) <= int(min_files): try: - os.path.remove(target_file) + os.remove(target_file) logging.info(f"{target_file} 文件不符合最小文件数规则,已删除") except Exception as e: logging.error(f"{target_file} 删除报错") @@ -550,7 +550,7 @@ class CBZUtils: try: return cls.comic_cbz_validate(dts_path) except Exception as e: - os.path.remove(dts_path) + os.remove(dts_path) @classmethod def replaceZip(cls, filepath, unpack_dir=None): diff --git a/Comics/pipelines.py b/Comics/pipelines.py index aa3f4fd..98a5a85 100644 --- a/Comics/pipelines.py +++ b/Comics/pipelines.py @@ -25,7 +25,7 @@ class ComicsPipeline(): # 使用 os.path.getsize() 获取文件大小(以字节为单位) file_size = os.path.getsize(file_path) if file_size < min_size: - os.path.remove(file_path) + os.remove(file_path) logging.info(f"清除错误文件: {file_path}") except Exception as e: print(f"获取文件大小失败: {e}")