fix: фильтрация macOS ._файлов и __MACOSX при извлечении zip

._ЛС-01-02-4-00-01 ВСП.xlsx — macOS resource fork, не настоящий xlsx.
Claude пытался его прочитать → верификация фейлила.
Теперь: не извлекаем ._ и __MACOSX из архива вообще.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-26 15:13:39 +10:00
co-authored by Claude Opus 4.6
parent c76c79cd56
commit 3c71eecbd8
2 changed files with 18 additions and 3 deletions
+5 -1
View File
@@ -130,10 +130,14 @@ def extract_zip(zip_path: str, dest_dir: str) -> list[str]:
info.filename = fixed
except (UnicodeDecodeError, UnicodeEncodeError):
pass # keep original if re-decode fails
# Skip macOS resource fork files and __MACOSX directory
basename = Path(info.filename).name
if basename.startswith('._') or '__MACOSX' in info.filename:
continue
z.extract(info, dest_dir)
files = []
for f in Path(dest_dir).rglob('*.xlsx'):
if not f.name.startswith('~$'):
if not f.name.startswith('~$') and not f.name.startswith('._'):
files.append(str(f))
return sorted(files)