os.makedirs(path, exist_ok=True) 会受到竞争条件影响吗?
1 个回答
3
查看一下这个源代码:
try:
makedirs(head, exist_ok=exist_ok)
except FileExistsError:
# Defeats race condition when another thread created the path
pass
所以如果其他人创建了相同的路径,也不会出现异常。