Tarfile extraction does not work on Windows
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- docker, python
调研方向
从 tarfile.extractall 和报告中展示的 members 过滤开始,然后使用 docker create 和 docker export 命令在 Windows 上重现该行为。将其与在 Linux 上使用相同 Python 版本进行的解压结果进行比较。当导出的 tar 存档能够在 Windows 上解压,且不会出现递归深度失败或无限循环时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Using Python 3.10.5, there is a scenario where the extractall function of tarfile is causing an infinite loop for Python on Windows, but not in Linux.
The tar-file where the issue occurred was the one produced by docker export, where a file-system is saved as a tar file. Unfortunately, it is too big to upload here, so I will give some commands to get this file.
> docker create --name "testcontainer" tomcat
> docker export --output="testtomcat.tar" testcontainer
That should produce a file of about 457MB.
Now, using Python 3.10.5 under Windows, the following code-snippet will crash:
import tarfile
with tarfile.open("testtomcat.tar") as tarf:
members_to_extract = [tar_info for tar_info in tarf.getmembers()
if not tar_info.isdev()]
tarf.extractall(path="/tmp/foo/", members=members_to_extract)
The error says: maximum recursion depth exceeded while calling a Python object
Your environment
- CPython versions tested on: Python 3.10.5
- Operating system and architecture: Windows 11 is where it failed, and it works fine with the same python version in Arch Linux with kernel
Linux 5.15.58-2-lts x86_64
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 558
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python/cpython 的其他 Issue
-
docs pending
难度 2/5 1-3 小时 新手友好度 78/100
-
stdlib type-feature
难度 2/5 1-3 小时 新手友好度 78/100
-
stdlib type-feature
难度 2/5 1-3 小时 新手友好度 72/100
-
build type-bug
难度 2/5 1-3 小时 新手友好度 76/100
-
stdlib topic-email type-feature
难度 2/5 1-3 小时 新手友好度 70/100
相似的 Issue
-
from:qa priority:P2 reliability tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
spec-kitty/spec-kitty#4874 ·
-
fix: inaccuracy ⚠️
难度 2/5 1-3 小时 新手友好度 72/100
uabrc/uabrc.github.io#1255 · 1 条评论 ·
-
kind:bug needs-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
docs
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 84/100
ethereum-optimism/factory#64 ·