Visitar URL original
[3.9] bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) by miss-islington · Pull Request #26191 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220202234541/https://github.com/python/cpython/pull/26191
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.9] bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) #26191

Merged
merged 1 commit into from May 17, 2021

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented May 17, 2021 •

shutil.unpack_archive() tries to read the whole file into memory, making no use of any kind of smaller buffer. Process crashes for really large files: I.e. archive: ~1.7G, unpacked: ~10G. Before the crash it can easily take away all available RAM on smaller systems. Had to pull the code form zipfile.Zipfile.extractall() to fix this

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit f32c795)

Co-authored-by: Igor Bolshakov ibolsch@gmail.com

https://bugs.python.org/issue43650

…large files (pythonGH-25058)

`shutil.unpack_archive()` tries to read the whole file into memory, making no use of any kind of smaller buffer. Process crashes for really large files: I.e. archive: ~1.7G, unpacked: ~10G. Before the crash it can easily take away all available RAM on smaller systems. Had to pull the code form `zipfile.Zipfile.extractall()` to fix this

Automerge-Triggered-By: GH:gpshead
(cherry picked from commit f32c795)

Co-authored-by: Igor Bolshakov <ibolsch@gmail.com>
@miss-islington miss-islington merged commit 049c412 into python:3.9 May 17, 2021
14 checks passed
@miss-islington miss-islington deleted the backport-f32c795-3.9 branch May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants