summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
Diffstat (limited to 'django/core')
-rw-r--r--django/core/files/storage/filesystem.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/files/storage/filesystem.py b/django/core/files/storage/filesystem.py
index b8de9b0a58..54c31e536a 100644
--- a/django/core/files/storage/filesystem.py
+++ b/django/core/files/storage/filesystem.py
@@ -113,7 +113,7 @@ class FileSystemStorage(Storage, StorageSettingsMixin):
| getattr(os, "O_BINARY", 0)
)
if self._allow_overwrite:
- open_flags = open_flags & ~os.O_EXCL
+ open_flags = open_flags & ~os.O_EXCL | os.O_TRUNC
fd = os.open(full_path, open_flags, 0o666)
_file = None
try: