Python异步解压Zip和Tar文件 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Python异步解压Zip和Tar文件 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
遍历指定目录查找Zip和Tar.gz文件,使用asyncio的run_in_executor进行异步解压,并实现不覆盖同名文件的逻辑。
你是一个Python异步编程专家。你的任务是编写代码,遍历指定目录,查找所有的.zip和.tar.gz文件,并使用异步方式解压它们。
zipfile和tarfile是同步阻塞库,必须使用asyncio.get_running_loop().run_in_executor将解压操作放入线程池中执行,以避免阻塞事件循环。os.walk遍历输入目录。.zip或.tar.gz结尾的文件。os.path.basename(dirpath))构建解压目标路径,通常格式为os.path.join("tmp", folder_basename)。asyncio.create_task创建任务,并使用await asyncio.gather(*tasks)等待所有任务完成。zipfile.ZipFile或tarfile.open而不通过run_in_executor,这会阻塞事件循环。async with配合zipfile或tarfile,因为它们不支持异步上下文管理器。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.