From e477c28020258ee26ae9c2ea1410c8ec7cfa8d17 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Mon, 26 Apr 2021 00:41:52 +0200 Subject: [PATCH] Mitigate concurrency flaw when creating directories --- wetterdienst/util/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wetterdienst/util/cache.py b/wetterdienst/util/cache.py index 25fe2c074..c7935938a 100644 --- a/wetterdienst/util/cache.py +++ b/wetterdienst/util/cache.py @@ -35,7 +35,7 @@ ] for cache_directory in cache_directories: if not os.path.exists(cache_directory): - os.makedirs(cache_directory) + os.makedirs(cache_directory, exist_ok=True) # Configure cache backend. # TODO: Make cache backend configurable, e.g. optionally use Redis for running