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

zipfile.py -> is_zipfile leaves file open when error #48491

Closed
eino mannequin opened this issue Oct 30, 2008 · 3 comments
Closed

zipfile.py -> is_zipfile leaves file open when error #48491

eino mannequin opened this issue Oct 30, 2008 · 3 comments
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@eino
Copy link
Mannequin

eino mannequin commented Oct 30, 2008

BPO 4241
Nosy @pitrou

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-12-27.15:52:05.483>
created_at = <Date 2008-10-30.11:52:02.668>
labels = ['library', 'type-crash']
title = 'zipfile.py -> is_zipfile leaves file open when error'
updated_at = <Date 2008-12-27.15:52:05.482>
user = 'https://bugs.python.org/eino'

bugs.python.org fields:

activity = <Date 2008-12-27.15:52:05.482>
actor = 'pitrou'
assignee = 'none'
closed = True
closed_date = <Date 2008-12-27.15:52:05.483>
closer = 'pitrou'
components = ['Library (Lib)']
creation = <Date 2008-10-30.11:52:02.668>
creator = 'eino'
dependencies = []
files = []
hgrepos = []
issue_num = 4241
keywords = []
message_count = 3.0
messages = ['75368', '78343', '78367']
nosy_count = 3.0
nosy_names = ['ggenellina', 'pitrou', 'eino']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue4241'
versions = ['Python 2.5']

@eino
Copy link
Mannequin Author

eino mannequin commented Oct 30, 2008

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()

@eino eino mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Oct 30, 2008
@ggenellina
Copy link
Mannequin

ggenellina mannequin commented Dec 27, 2008

The patch for bpo-4756 fixes this too.

@pitrou
Copy link
Member

pitrou commented Dec 27, 2008

Fixed by Gabriel's patch (just committed in trunk and py3k).

@pitrou pitrou closed this as completed Dec 27, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

1 participant