summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-05-17 18:29:41 +0200
committerClaude Paroz <claude@2xlibre.net>2013-05-17 18:31:52 +0200
commit838f28974e0711f4184798ba5e54ad725bc112f0 (patch)
treee65c07acea7dbde917eff2384804a205b72d9009
parent0509462373187948fa51366cf4e189c60d6d6688 (diff)
Fixed #20427 -- Moved a variable initialization in storage.py
This is fixing commit 4e70ad11d2. Thanks mattias at elements.nl for the report and Baptiste Mispelon for identifying the faulty commit.
-rw-r--r--django/core/files/storage.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/files/storage.py b/django/core/files/storage.py
index 89caf3675d..18d15e1ab6 100644
--- a/django/core/files/storage.py
+++ b/django/core/files/storage.py
@@ -200,9 +200,9 @@ class FileSystemStorage(Storage):
getattr(os, 'O_BINARY', 0))
# The current umask value is masked out by os.open!
fd = os.open(full_path, flags, 0o666)
+ _file = None
try:
locks.lock(fd, locks.LOCK_EX)
- _file = None
for chunk in content.chunks():
if _file is None:
mode = 'wb' if isinstance(chunk, bytes) else 'wt'