Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Dengda98
Copy link
Contributor

replaces a non-atomic pattern for directory creation:

if not os.path.exists(dirname):
    os.makedirs(dirname)

with the safer:

os.makedirs(dirname, exist_ok=True)

In the parallel state (merged in #110 ), the original pattern is prone to race conditions: two processes may check for directory existence and both attempt to create it at the same time, will case FileExistsError. Using exist_ok=True makes directory creation atomic and thread-safe.

@Dengda98
Copy link
Contributor Author

Can it be merged?

@shimizukawa shimizukawa merged commit 6d36662 into sphinx-doc:master Jul 20, 2025
8 checks passed
@shimizukawa
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants