Tarfile extraction does not work on Windows
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- docker, python
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Bắt đầu với tarfile.extractall và phần lọc members được nêu trong báo cáo, sau đó tái hiện hành vi trên Windows bằng các lệnh docker create và docker export. So sánh việc giải nén với cùng phiên bản Python trên Linux. Hoàn tất khi tệp lưu trữ tar đã xuất có thể được giải nén trên Windows mà không xảy ra lỗi do vượt quá độ sâu đệ quy hoặc vòng lặp vô hạn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 558
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python/cpython
-
docs pending
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
stdlib type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
build type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
stdlib topic-email type-feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Tất cả issue của python/cpython
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
bancolombia/sentinel#23 ·
-
test md Đang mởCI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100