Skip to content
Browse files

[py3] fixed session file backend.

  • Loading branch information...
1 parent 4d393e1 commit f2fff84bc3e85b9c9c132dec614e8b293df8f6bb @apollo13 apollo13 committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/contrib/sessions/backends/
3 django/contrib/sessions/backends/
@@ -5,6 +5,7 @@
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
+from django.utils.encoding import smart_bytes
class SessionStore(SessionBase):
@@ -115,7 +116,7 @@ def save(self, must_create=False):
renamed = False
- os.write(output_file_fd, self.encode(session_data))
+ os.write(output_file_fd, self.encode(session_data).encode())
os.rename(output_file_name, session_file_name)

2 comments on commit f2fff84

Django member

I guess the smart_bytes import is a remainder of trials?

Django member

Guessed right, will fix it.

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