Issue 20102: shutil._make_zipfile possible resource leak (original) (raw)

Issue20102

Created on 2014-01-01 11:21 by peter@psantoro.net, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
shutil.diff peter@psantoro.net,2014-01-01 11:21 patch
Messages (2)
msg207132 - (view) Author: Peter Santoro (peter@psantoro.net) * Date: 2014-01-01 11:21
Now that zipfile.ZipFile supports the context manager protocol, shouldn't shutil._make_zipfile make use of it to avoid the possibility of the archive file not being closed properly if an exception occurs? It should be noted that shutil._unpack_zipfile does use try/finally to ensure that files are closed.
msg210009 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-02-02 20:31
New changeset 767d034b3feb by Benjamin Peterson in branch '2.7': use with statement to ensure zipfile is always closed (closes #20102) http://hg.python.org/cpython/rev/767d034b3feb New changeset 838674d15b5b by Benjamin Peterson in branch '3.3': use with statement to ensure zipfile is always closed (closes #20102) http://hg.python.org/cpython/rev/838674d15b5b New changeset 20aa07f93ca7 by Benjamin Peterson in branch 'default': merge 3.3 (#20102) http://hg.python.org/cpython/rev/20aa07f93ca7
History
Date User Action Args
2022-04-11 14:57:56 admin set github: 64301
2014-02-02 20:31:24 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2014-01-01 11:21:17 peter@psantoro.net create