Skip to content

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

Closed

Description

@eino
mannequin
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']

Activity

  1. eino commented on Oct 30, 2008

    einomannequin
    MannequinAuthor

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

  2. added
    stdlib
    type-crash
    on Oct 30, 2008
  3. ggenellina commented on Dec 27, 2008

    ggenellinamannequin
    Mannequin

    The patch for bpo-4756 fixes this too.

  4. pitrou commented on Dec 27, 2008

    @pitrou
    Member

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

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibtype-crash

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions