From 9fae8d0ae16bde327d3a86dc7651f1976f8e6856 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 26 Nov 2021 11:30:33 -0800 Subject: [PATCH] Backport PR #13334: Fix race condition in paths.get_ipython_dirs() --- IPython/paths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IPython/paths.py b/IPython/paths.py index e7f8aee3070..e19269058af 100644 --- a/IPython/paths.py +++ b/IPython/paths.py @@ -67,7 +67,7 @@ def get_ipython_dir() -> str: " using a temp directory.".format(parent)) ipdir = tempfile.mkdtemp() else: - os.makedirs(ipdir) + os.makedirs(ipdir, exist_ok=True) assert isinstance(ipdir, str), "all path manipulation should be str(unicode), but are not." return ipdir