Commit 838f2897 authored by Claude Paroz's avatar Claude Paroz
Browse files

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

This is fixing commit 4e70ad11. Thanks mattias at elements.nl
for the report and Baptiste Mispelon for identifying the faulty
commit.
parent 05094623
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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'