Message335769
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. |
|
Date |
User |
Action |
Args |
2019-02-17 11:12:33 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, giampaolo.rodola, chris.jerdonek, ammar2, nanjekyejoannah |
2019-02-17 11:12:33 | serhiy.storchaka | set | messageid: <1550401953.39.0.438614693472.issue35951@roundup.psfhosted.org> |
2019-02-17 11:12:33 | serhiy.storchaka | link | issue35951 messages |
2019-02-17 11:12:33 | serhiy.storchaka | create | |
|