mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
[py3] Fixed more encoding issues in cache tests
This commit is contained in:
3
django/core/cache/backends/db.py
vendored
3
django/core/cache/backends/db.py
vendored
@@ -12,6 +12,7 @@ from django.conf import settings
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
from django.db import connections, router, transaction, DatabaseError
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import smart_bytes
|
||||
|
||||
|
||||
class Options(object):
|
||||
@@ -72,7 +73,7 @@ class DatabaseCache(BaseDatabaseCache):
|
||||
transaction.commit_unless_managed(using=db)
|
||||
return default
|
||||
value = connections[db].ops.process_clob(row[1])
|
||||
return pickle.loads(base64.b64decode(value))
|
||||
return pickle.loads(base64.b64decode(smart_bytes(value)))
|
||||
|
||||
def set(self, key, value, timeout=None, version=None):
|
||||
key = self.make_key(key, version=version)
|
||||
|
||||
Reference in New Issue
Block a user