mirror of
https://github.com/django/django.git
synced 2025-01-12 19:37:06 +00:00
[py3] fixed session file backend.
This commit is contained in:
parent
4d393e1bd9
commit
f2fff84bc3
@ -5,6 +5,7 @@ import tempfile
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.sessions.backends.base import SessionBase, CreateError
|
from django.contrib.sessions.backends.base import SessionBase, CreateError
|
||||||
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
|
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
|
||||||
|
from django.utils.encoding import smart_bytes
|
||||||
|
|
||||||
|
|
||||||
class SessionStore(SessionBase):
|
class SessionStore(SessionBase):
|
||||||
@ -115,7 +116,7 @@ class SessionStore(SessionBase):
|
|||||||
renamed = False
|
renamed = False
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
os.write(output_file_fd, self.encode(session_data))
|
os.write(output_file_fd, self.encode(session_data).encode())
|
||||||
finally:
|
finally:
|
||||||
os.close(output_file_fd)
|
os.close(output_file_fd)
|
||||||
os.rename(output_file_name, session_file_name)
|
os.rename(output_file_name, session_file_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user