Skip to content

Commit 27bc01d

Browse files
committed
fix: skip macOS specific metadata directories and files in zip parsing
--bug=1054264 --user=刘瑞斌 【知识库】QA问答对模式,导入在mac上压缩的zip文件,会出现2个乱码文档 https://www.tapd.cn/57709429/s/1679674
1 parent bd90011 commit 27bc01d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/common/handle/impl/qa/zip_parse_qa_handle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ def handle(self, file, get_buffer, save_image):
132132
files = zip_ref.namelist()
133133
# 读取压缩包中的文件内容
134134
for file in files:
135-
if file.endswith('/'):
135+
# 跳过 macOS 特有的元数据目录和文件
136+
if file.endswith('/') or file.startswith('__MACOSX'):
136137
continue
137138
with zip_ref.open(file) as f:
138139
# 对文件内容进行处理

0 commit comments

Comments
 (0)