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

Tal Cohen report at bugs.python.org
Tue Jul 30 18:27:02 EDT 2019


New submission from Tal Cohen <3talcohen at gmail.com>:

_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?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37724>
_______________________________________


More information about the Python-bugs-list mailing list