﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30147	Simplify directory creation with os.makedirs(..., exist_ok=True)	Jon Dufresne	nobody	"The pattern:

{{{
if not os.path.exists(path):
    os.makedirs(path)
}}}

Can be simplified to:

{{{
os.makedirs(path, exist_ok=True
}}}

The `exist_ok` argument was added in Python 3.2:

https://docs.python.org/3/library/os.html#os.makedirs

The original pattern also has a potential race condition where a process could create a directory at `path` after the check but before the `os.makedirs()` call. If such a race condition were to occur, the Django process would result in a `FileExistsError`. `os.makedirs` handles this condition.
"	Cleanup/optimization	closed	Uncategorized	dev	Normal	fixed			Unreviewed	1	0	0	0	0	0
