Skip to content

[[Errno 17] File exists: ] # Try create directories that are not part of the archive with #81905

Closed as not planned

Description

@TalCohen
mannequin
BPO 37724
Nosy @gustaebel, @taleinat, @nanjekyejoannah, @websurfer5, @potomak

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 2019-07-30.22:20:23.092>
labels = ['library']
title = '[[Errno 17] File exists: ] # Try create directories that are not part of the archive with'
updated_at = <Date 2020-08-07.05:26:20.931>
user = 'https://bugs.python.org/TalCohen'

bugs.python.org fields:

activity = <Date 2020-08-07.05:26:20.931>
actor = 'Jeffrey.Kintscher'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2019-07-30.22:20:23.092>
creator = 'Tal Cohen'
dependencies = []
files = []
hgrepos = []
issue_num = 37724
keywords = []
message_count = 5.0
messages = ['348772', '348833', '348849', '348912', '373162']
nosy_count = 6.0
nosy_names = ['lars.gustaebel', 'taleinat', 'nanjekyejoannah', 'Jeffrey.Kintscher', 'potomak', 'Tal Cohen']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue37724'
versions = ['Python 2.7']

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Jul 30, 2019
  2. TalCohen commented on Jul 30, 2019

    TalCohenmannequin
    MannequinAuthor

    _extract_member, raised an exception in case of more than one process, This happens because "not os.path.exists(upperdirs" return True in case of multiprocess

    CODE:
    .............
    if upperdirs and not os.path.exists(upperdirs):
    # Create directories that are not part of the archive with
    # default permissions.
    os.makedirs(upperdirs)
    ................

    I solved the problem by creating the root path before like:
    try:
    os.makedirs(path)
    except OSError as e:
    if e.errno != os.errno.EEXIST:
    raise
    pass

    there is an option to add :
    if e.errno != os.errno.EEXIST: in your code?

  3. potomak commented on Aug 1, 2019

    potomakmannequin
    Mannequin

    There's also the makedirs's exist_ok optional parameter, False by default. You could use it to avoid this error, but I'm not an expert on this particular library, so I'm not sure if it would make sense to make this change.

    On a side note, searching for _extract_member, I found a very similar implementation of that function in tarfile.py. In case I think we should apply the same behavior in that module too.

  4. TalCohen commented on Aug 1, 2019

    TalCohenmannequin
    MannequinAuthor

    Thanks

  5. taleinat commented on Aug 2, 2019

    @taleinat
    Contributor

    Hi Tal, could you please make your report clearer by giving more context? Right now it is very hard to understand.

    The following would be helpful:

    • What are you trying to do that is failing? (perhaps extract a Zip archive?)
    • Which libraries/classes/functions are you using?
    • Can you provide a small sample of code which we can use to reproduce this error ourselves?
  6. nanjekyejoannah commented on Jul 6, 2020

    @nanjekyejoannah
    Contributor

    This is marked 2.7 is it still relevant?

  7. transferred this issue fromon Apr 10, 2022
  8. iritkatriel commented on Apr 4, 2023

    @iritkatriel
    Member

    There's been no reply to @taleinat's questions, so I am closing this as abandoned. If there is still a problem, this can be reopened or a new issue created.

  9. serhiy-storchaka commented on Feb 17, 2024

    @serhiy-storchaka
    Member

    It was a duplicate of #67837.

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

    stdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions