This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Possible resources leak in tarfile.open()
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: 20243 Superseder:
Assigned To: serhiy.storchaka Nosy List: lars.gustaebel, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2014-01-13 20:26 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tarfile_file_leak.patch serhiy.storchaka, 2014-01-13 20:26 review
Messages (3)
msg208046 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-01-13 20:26
There are possible opened file leaks when unexpected error is occurred in tarfile.open for bzip2- or xz-compressed files (and gzip2-compressed in 2.7). Here is a patch. Unfortunately I have no tests.
msg208402 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-01-18 14:31
New changeset 05d186a1a367 by Serhiy Storchaka in branch '3.3':
Issue #20244: Fixed possible file leaks when unexpected error raised in
http://hg.python.org/cpython/rev/05d186a1a367

New changeset 0386cde12657 by Serhiy Storchaka in branch 'default':
Issue #20244: Fixed possible file leaks when unexpected error raised in
http://hg.python.org/cpython/rev/0386cde12657
msg208403 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-01-18 15:22
As for 2.7, I suppose it have file leaks even when expected exception is raised. 2.7 needs more tests and perhaps changes for GzipFile. This was not fixed in issue11513 and is not fixed here.
History
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64443
2014-01-18 15:22:14serhiy.storchakasetstatus: open -> closed
versions: - Python 2.7
messages: + msg208403

resolution: fixed
stage: patch review -> resolved
2014-01-18 14:31:42python-devsetnosy: + python-dev
messages: + msg208402
2014-01-13 20:27:08serhiy.storchakasetdependencies: + ReadError when open a tarfile for writing
2014-01-13 20:26:34serhiy.storchakacreate