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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user