]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 17 May 2021 17:35:30 +0000 (10:35 -0700)
committerGitHub <noreply@github.com>
Mon, 17 May 2021 17:35:30 +0000 (10:35 -0700)
commit7a588621c2854bcef6ce9eeb54349b84ac078c45
treec1e1af0067b06c305b63c78b61dc4077dafcd6d2
parent60fa8b32dbfe452b81c44d2b8a96325fb19a206d
bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058) (GH-26190)

`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 f32c7950e0077b6d9a8e217c2796fc582f18ca08)

Co-authored-by: Igor Bolshakov <ibolsch@gmail.com>
Lib/shutil.py
Misc/NEWS.d/next/Library/2021-03-29-00-23-30.bpo-43650.v01tic.rst [new file with mode: 0644]