Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…#4912) The `Folder` and `SandboxFolder` classes of `aiida.common.folders` used the following paradigm to create the required folders: if not os.path.exists(filepath): os.makedirs(filepath) However, this is susceptible to a race condition. If two processes call the same piece of code almost at the same time, they may both evaluate the conditional to be True if the filepath does not yet exist, but one of the two will actually get to the creation first, causing the second process to except with a `FileExistsError`. The solution is to replace it with `os.makedirs(filepath, exist_ok=True)` which will swallow the exception if the path already exists. Cherry-pick: dc686c5
- Loading branch information