From 53de20725f9284fd4cdea03a608a30409afcc47d 2021-11-26 19:11:07 From: Matthias Bussonnier Date: 2021-11-26 19:11:07 Subject: [PATCH] Fix race condition in paths.get_ipython_dirs(), Directory may already exists. Use octomerge to get everyboy's contributions. Merge remote-tracking branches 'origin/pull/13256' and 'origin/pull/13263' --- diff --git a/IPython/paths.py b/IPython/paths.py index a2ea5bc..f96ec4d 100644 --- a/IPython/paths.py +++ b/IPython/paths.py @@ -72,7 +72,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