Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/google/appengine/ext/deferred/deferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def hello_world():




import base64
import http
import logging
import os
Expand Down Expand Up @@ -159,7 +159,7 @@ def run(data):
PermanentTaskFailure if an error occurred during unpickling the task.
"""
try:
func, args, kwds = pickle.loads(data)
func, args, kwds = pickle.loads(base64.b64decode(data))
except Exception as e:
raise PermanentTaskFailure(e)
else:
Expand Down Expand Up @@ -265,10 +265,10 @@ def serialize(obj, *args, **kwargs):
"""
curried = _curry_callable(obj, *args, **kwargs)
if os.environ.get("DEFERRED_USE_CROSS_COMPATIBLE_PICKLE_PROTOCOL", False):
protocol = 0
protocol = 2
else:
protocol = pickle.HIGHEST_PROTOCOL
return pickle.dumps(curried, protocol)
return base64.b64encode(pickle.dumps(curried, protocol))


def defer(obj, *args, **kwargs):
Expand Down