Skip to content

ZipFile.extractall is not multiprocess safe with regard to directory creation. #84284

Closed

Description

@nathansilberman
BPO 40103
Nosy @Yhg1s, @serhiy-storchaka, @nathansilberman
PRs
  • bpo-40103: Ensuring that ZipFiles with overlapping directories can be extracted simultaneously from multiple processes. #19216
  • 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 2020-03-29.16:33:47.483>
    labels = ['3.7', '3.8', 'type-bug', 'library', '3.9']
    title = 'ZipFile.extractall is not multiprocess safe with regard to directory creation.'
    updated_at = <Date 2020-05-22.20:15:02.673>
    user = 'https://github.com/nathansilberman'

    bugs.python.org fields:

    activity = <Date 2020-05-22.20:15:02.673>
    actor = 'cheryl.sabella'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-03-29.16:33:47.483>
    creator = 'nathansilberman'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40103
    keywords = ['patch']
    message_count = 1.0
    messages = ['365268']
    nosy_count = 3.0
    nosy_names = ['twouters', 'serhiy.storchaka', 'nathansilberman']
    pr_nums = ['19216']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40103'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. nathansilberman commented on Mar 29, 2020

      nathansilbermanmannequin
      MannequinAuthor

      When extracting multiple zip files, each from a separate process, if the files being extracted are in nested directories and files across zips contain the same parent directories, the extraction process fails as one zip attempts to create a directory that was already created by the extraction call in another process.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Mar 29, 2020
    3. transferred this issue fromon Apr 10, 2022
    4. gpshead commented on May 4, 2023

      @gpshead
      Member

      This is basically asking for zipfile to have a mode where the filesystem it is extracting to can change out from underneath it mid-extraction and it should just ignore errors and continue on.

      An ignore_errors=True style of feature is probably feasible to implement, but I don't think it'd ever be a good idea for someone to use it...

    5. emmatyping commented on May 20, 2024

      @emmatyping
      Member

      This was duplicated and resolved in #112998 and 5d2794a respectively. I believe this issue can be closed.

    6. gpshead commented on May 20, 2024

      @gpshead
      Member

      agreed, #115082 appears to have fixed it.

    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

      3.7 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions