Issue 4241: zipfile.py -> is_zipfile leaves file open when error (original) (raw)

Issue4241

Created on 2008-10-30 11:52 by eino, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg75368 - (view) Author: Eino Mäkitalo (eino) Date: 2008-10-30 11:52
Very simple error. If is_zipfile crashes when checking is_zipfile if zipfile is corrupted or not at all zip. It leaves file open and prevents later to remove file etc... Maybe it's corrected in next versions Old code: zipfile... line 86: endrec = _EndRecData(fpin) line 87: fpin.close My simple corrections to cope with this try: endrec = _EndRecData(fpin) finally: fpin.close()
msg78343 - (view) Author: Gabriel Genellina (ggenellina) Date: 2008-12-27 05:45
The patch for fixes this too.
msg78367 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-27 15:52
Fixed by Gabriel's patch (just committed in trunk and py3k).
History
Date User Action Args
2022-04-11 14:56:40 admin set github: 48491
2008-12-27 15:52:05 pitrou set status: open -> closedresolution: fixedmessages: + nosy: + pitrou
2008-12-27 05:45:56 ggenellina set nosy: + ggenellinamessages: +
2008-10-30 11:52:02 eino create