From 98ef3829e96ebc73d4d446f92465e671ff520d2b Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 31 Oct 2018 19:25:53 -0400 Subject: Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory. Regression in 632c4ffd9cb1da273303bcd8005fff216506c795. --- django/core/files/storage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/core/files/storage.py b/django/core/files/storage.py index a6498724eb..9a7d8793fc 100644 --- a/django/core/files/storage.py +++ b/django/core/files/storage.py @@ -240,9 +240,9 @@ class FileSystemStorage(Storage): os.umask(old_umask) else: os.makedirs(directory) - except FileNotFoundError: + except FileExistsError: # There's a race between os.path.exists() and os.makedirs(). - # If os.makedirs() fails with FileNotFoundError, the directory + # If os.makedirs() fails with FileExistsError, the directory # was created concurrently. pass if not os.path.isdir(directory): -- cgit v1.3