Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[py3] fixed session file backend.

  • Loading branch information...
commit f2fff84bc3e85b9c9c132dec614e8b293df8f6bb 1 parent 4d393e1
Florian Apolloner apollo13 authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/contrib/sessions/backends/file.py
3  django/contrib/sessions/backends/file.py
View
@@ -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
try:
try:
- os.write(output_file_fd, self.encode(session_data))
+ os.write(output_file_fd, self.encode(session_data).encode())
finally:
os.close(output_file_fd)
os.rename(output_file_name, session_file_name)

2 comments on commit f2fff84

Claude Paroz
Collaborator

I guess the smart_bytes import is a remainder of trials?

Florian Apolloner
Owner

Guessed right, will fix it.

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