Skip to content

minor fix to avoid error of directory already exists while using Mult…#388

Merged
quaquel merged 2 commits intoquaquel:masterfrom
pollockDeVis:master
Aug 14, 2025
Merged

minor fix to avoid error of directory already exists while using Mult…#388
quaquel merged 2 commits intoquaquel:masterfrom
pollockDeVis:master

Conversation

@pollockDeVis
Copy link
Copy Markdown
Contributor

When using ArchiveLogger with multiprocessing, a FileExistsError may occur if multiple processes attempt to create the same tmp directory using os.mkdir. This PR fixes the issue by replacing os.mkdir(self.temp) with os.makedirs(self.temp, exist_ok=True), which avoids errors if the directory already exists.

Error before this fix:

FileExistsError: [Errno 17] File exists: '.../tmp'

Summary of change:

Replaced os.mkdir(self.temp) with os.makedirs(self.temp, exist_ok=True) in ArchiveLogger class inside optimization.py.

@quaquel quaquel merged commit 0494300 into quaquel:master Aug 14, 2025
8 of 10 checks passed
@quaquel quaquel mentioned this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants