Loading django/contrib/sessions/backends/file.py +6 −1 Original line number Diff line number Diff line import datetime import errno import os import shutil import tempfile from django.conf import settings Loading Loading @@ -147,7 +148,11 @@ class SessionStore(SessionBase): os.write(output_file_fd, self.encode(session_data).encode()) finally: os.close(output_file_fd) os.rename(output_file_name, session_file_name) # This will atomically rename the file (os.rename) if the OS # supports it. Otherwise this will result in a shutil.copy2 # and os.unlink (for example on Windows). See #9084. shutil.move(output_file_name, session_file_name) renamed = True finally: if not renamed: Loading Loading
django/contrib/sessions/backends/file.py +6 −1 Original line number Diff line number Diff line import datetime import errno import os import shutil import tempfile from django.conf import settings Loading Loading @@ -147,7 +148,11 @@ class SessionStore(SessionBase): os.write(output_file_fd, self.encode(session_data).encode()) finally: os.close(output_file_fd) os.rename(output_file_name, session_file_name) # This will atomically rename the file (os.rename) if the OS # supports it. Otherwise this will result in a shutil.copy2 # and os.unlink (for example on Windows). See #9084. shutil.move(output_file_name, session_file_name) renamed = True finally: if not renamed: Loading