Skip to content
Snippets Groups Projects
Commit 59b0554c authored by Feanil Patel's avatar Feanil Patel
Browse files

Update encoding to be latin1 when loading pickled data to be able to read python 2 datettimes.

parent 29cc071e
No related branches found
No related tags found
No related merge requests found
......@@ -2,17 +2,19 @@
Utilities related to caching.
"""
from __future__ import absolute_import
import collections
import functools
import itertools
import zlib
import wrapt
import six
import wrapt
from django.utils.encoding import force_text
from edx_django_utils.cache import RequestCache
from six import iteritems
from six.moves import map
from six.moves import cPickle as pickle
from six.moves import map
def request_cached(namespace=None, arg_map_function=None, request_cache_getter=None):
......@@ -156,7 +158,10 @@ def zpickle(data):
def zunpickle(zdata):
"""Given a zlib compressed pickled serialization, returns the deserialized data."""
return pickle.loads(zlib.decompress(zdata))
if six.PY2:
return pickle.loads(zlib.decompress(zdata))
else:
return pickle.loads(zlib.decompress(zdata), encoding='latin1')
def get_cache(name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment