zipfile can't extract file: file name in directory and header differ

Open
#51,088 65 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Begin with test.zip and the historical zipfile_276_filename_mismatch_v2/v3 and zipfile_340_filename_mismatch_v3 patches, then review PR #14212 and the surrounding discussion. Trace the zipfile behavior they target and confirm the intended handling of differing directory and header names, along with regression coverage, before making changes.

Written by the indexing model from the issue text.

Description

3.7 (EOL) OS-windows stdlib type-bug
BPO 6839
Nosy @birkenfeld, @terryjreedy, @gpshead, @ronaldoussoren, @amauryfa, @ncoghlan, @berkerpeksag, @jimjjewett, @serhiy-storchaka, @MorganRamsay
PRs
  • python/cpython#14212
  • Files
  • test.zip: mildly corrupt zipfile to test error handling
  • zlib_forward_slash.patch
  • zipfile_276_filename_mismatch_v2.patch: patch with warnings against 2.7.6
  • zipfile_340_filename_mismatch_v3.patch: patch with warnings against 3.4.0
  • zipfile_276_filename_mismatch_v3.patch: patch with print against 2.7.6
  • 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 = None
    created_at = <Date 2009-09-04.19:56:49.966>
    labels = ['3.7', 'type-bug', 'library', 'OS-windows']
    title = "zipfile can't extract file"
    updated_at = <Date 2019-06-18.21:36:54.889>
    user = 'https://bugs.python.org/NewerCookie'
    

    bugs.python.org fields:

    activity = <Date 2019-06-18.21:36:54.889>
    actor = 'python-dev'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2009-09-04.19:56:49.966>
    creator = 'NewerCookie'
    dependencies = []
    files = ['14832', '14934', '35115', '35117', '35120']
    hgrepos = []
    issue_num = 6839
    keywords = ['patch']
    message_count = 61.0
    messages = ['92265', '92297', '92309', '92326', '92330', '92335', '92516', '92874', '116384', '116385', '200165', '201842', '208970', '208973', '208975', '208982', '208983', '208985', '208987', '209023', '211562', '217533', '217546', '217551', '217554', '217556', '217558', '217561', '217569', '217570', '217571', '217572', '217573', '217574', '217575', '217576', '217578', '217616', '217624', '217625', '217627', '217634', '217635', '217636', '217638', '217641', '217642', '217643', '217647', '217648', '217659', '217660', '217661', '217743', '217753', '217754', '217756', '217778', '217932', '217933', '345999']
    nosy_count = 15.0
    nosy_names = ['georg.brandl', 'terry.reedy', 'gregory.p.smith', 'ronaldoussoren', 'amaury.forgeotdarc', 'ncoghlan', 'NewerCookie', 'chuck', 'francismb', 'berker.peksag', 'Jim.Jewett', 'serhiy.storchaka', 'apolkosnik', 'Sean Goodwin', 'MorganRamsay']
    pr_nums = ['14212']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6839'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6', 'Python 3.7']
    

    Dominant language
    Python
    Stars
    77.2k
    Forks
    36k
    Avg merge
    1d 9h
    Merged PRs (30d)
    558

    Contributor guide

    Open the contributing guide

    First steps

    1. Read the whole issue, then the project's contributing guide.
    2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
    3. Fork the repository and make your change on a branch.
    4. Open a pull request that references the issue number.

    More from python/cpython

    All issues in python/cpython

    Similar issues

    More Python issues

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.