You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[[Errno 17] File exists: ] # Try create directories that are not part of the archive with #81905
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=Noneclosed_at=Nonecreated_at=<Date2019-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=<Date2020-08-07.05:26:20.931>user='https://bugs.python.org/TalCohen'
_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?
potomak commented on Aug 1, 2019
potomakmannequin
Mannequin
More actions
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.
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.
Activity
TalCohen commentedon Jul 30, 2019
_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?
potomak commentedon Aug 1, 2019
There's also the
makedirs'sexist_okoptional parameter,Falseby 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 intarfile.py. In case I think we should apply the same behavior in that module too.TalCohen commentedon Aug 1, 2019
Thanks
taleinat commentedon Aug 2, 2019
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:
nanjekyejoannah commentedon Jul 6, 2020
This is marked 2.7 is it still relevant?
iritkatriel commentedon Apr 4, 2023
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.
serhiy-storchaka commentedon Feb 17, 2024
It was a duplicate of #67837.