From 675adeeb63bb8a1362490f92deb90a0127ccddba Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 7 Apr 2025 10:37:06 +0800 Subject: [PATCH] fix: exclude macOS specific files from zip processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1054264 --user=刘瑞斌 【知识库】QA问答对模式,导入在mac上压缩的zip文件,会出现2个乱码文档 https://www.tapd.cn/57709429/s/1681034 --- apps/common/handle/impl/zip_split_handle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/handle/impl/zip_split_handle.py b/apps/common/handle/impl/zip_split_handle.py index 76af4485a..8d931c9e7 100644 --- a/apps/common/handle/impl/zip_split_handle.py +++ b/apps/common/handle/impl/zip_split_handle.py @@ -126,7 +126,7 @@ class ZipSplitHandle(BaseSplitHandle): files = zip_ref.namelist() # 读取压缩包中的文件内容 for file in files: - if file.endswith('/'): + if file.endswith('/') or file.startswith('__MACOSX'): continue with zip_ref.open(file) as f: # 对文件内容进行处理