Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
59b0554c
Commit
59b0554c
authored
5 years ago
by
Feanil Patel
Browse files
Options
Downloads
Patches
Plain Diff
Update encoding to be latin1 when loading pickled data to be able to read python 2 datettimes.
parent
29cc071e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openedx/core/lib/cache_utils.py
+8
-3
8 additions, 3 deletions
openedx/core/lib/cache_utils.py
with
8 additions
and
3 deletions
openedx/core/lib/cache_utils.py
+
8
−
3
View file @
59b0554c
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment