Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #20427 -- Moved a variable initialization in storage.py

This is fixing commit 4e70ad1. Thanks mattias at elements.nl
for the report and Baptiste Mispelon for identifying the faulty
commit.
  • Loading branch information...
commit 838f28974e0711f4184798ba5e54ad725bc112f0 1 parent 0509462
Claude Paroz authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/files/storage.py
2  django/core/files/storage.py
@@ -200,9 +200,9 @@ def _save(self, name, content):
200 200
                              getattr(os, 'O_BINARY', 0))
201 201
                     # The current umask value is masked out by os.open!
202 202
                     fd = os.open(full_path, flags, 0o666)
  203
+                    _file = None
203 204
                     try:
204 205
                         locks.lock(fd, locks.LOCK_EX)
205  
-                        _file = None
206 206
                         for chunk in content.chunks():
207 207
                             if _file is None:
208 208
                                 mode = 'wb' if isinstance(chunk, bytes) else 'wt'

0 notes on commit 838f289

Please sign in to comment.
Something went wrong with that request. Please try again.