diff options
| author | Tim Graham <timograham@gmail.com> | 2018-10-31 19:25:53 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-31 19:28:11 -0400 |
| commit | 98ef3829e96ebc73d4d446f92465e671ff520d2b (patch) | |
| tree | 2e0591e7d56a0dda5b85853e52795ea9f41746a9 /django | |
| parent | 3d4d0a25b299a97314582156a0d63d939662d310 (diff) | |
Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory.
Regression in 632c4ffd9cb1da273303bcd8005fff216506c795.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/files/storage.py | 4 |
1 files changed, 2 insertions, 2 deletions
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): |
