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: Extracting a directory that already exists generates an OSError #50300

Closed
joeamenta mannequin opened this issue May 18, 2009 · 4 comments
Closed

zipfile: Extracting a directory that already exists generates an OSError #50300

joeamenta mannequin opened this issue May 18, 2009 · 4 comments
Assignees
Labels
release-blocker stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@joeamenta
Copy link
Mannequin

joeamenta mannequin commented May 18, 2009

BPO 6050
Nosy @loewis, @benjaminp, @ezio-melotti
Files
  • zipdiff.diff: extract() tests if dir exists, does not try to os.mkdir if it already does.
  • 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 = 'https://github.com/loewis'
    closed_at = <Date 2009-05-24.19:55:45.959>
    created_at = <Date 2009-05-18.05:01:39.617>
    labels = ['type-bug', 'library', 'release-blocker']
    title = 'zipfile: Extracting a directory that already exists generates an OSError'
    updated_at = <Date 2010-07-29.16:35:15.433>
    user = 'https://bugs.python.org/joeamenta'

    bugs.python.org fields:

    activity = <Date 2010-07-29.16:35:15.433>
    actor = 'ezio.melotti'
    assignee = 'loewis'
    closed = True
    closed_date = <Date 2009-05-24.19:55:45.959>
    closer = 'loewis'
    components = ['Library (Lib)']
    creation = <Date 2009-05-18.05:01:39.617>
    creator = 'joe.amenta'
    dependencies = []
    files = ['14005']
    hgrepos = []
    issue_num = 6050
    keywords = ['patch']
    message_count = 4.0
    messages = ['88014', '88243', '88277', '111962']
    nosy_count = 4.0
    nosy_names = ['loewis', 'benjamin.peterson', 'ezio.melotti', 'joe.amenta']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue6050'
    versions = ['Python 3.1', 'Python 2.7']

    @joeamenta
    Copy link
    Mannequin Author

    joeamenta mannequin commented May 18, 2009

    zipfile.ZipFile.extract() fails if targetpath is a directory that
    already exists.

    Bug revealed itself on Ubuntu, using extractall().

    Happened on the latest 3.1 and 2.7.

    Attached a patch that I think will fix this issue.

    @joeamenta joeamenta mannequin added the stdlib Python modules in the Lib dir label May 18, 2009
    @loewis loewis mannequin added the release-blocker label May 18, 2009
    @loewis loewis mannequin self-assigned this May 18, 2009
    @benjaminp
    Copy link
    Contributor

    It would be nice to have a test with the patch.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented May 24, 2009

    Thanks for the patch. Committed with modifications (including a test) as
    r72893, r72894, r72895, r72896.

    @loewis loewis mannequin closed this as completed May 24, 2009
    @ezio-melotti
    Copy link
    Member

    bpo-9172 has been closed as duplicate of this.

    @ezio-melotti ezio-melotti added the type-bug An unexpected behavior, bug, or error label Jul 29, 2010
    @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
    release-blocker stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants