Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

There are possible race conditions. Other process can create the same target 
directory (if it does not exist yet) by calling os.makedirs() for example. It 
will be impolite to remove the directory just after the second process checked 
that it exists (or even after it created it).

Also, the created directory will left if the program crash before deleting it.

os.renames() to non-existing directory can not be atomic. It can interfere with 
other processes or threads. We should just document this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35951>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to