From 74eacf95fdcce35e981cc3ad64a9d6991edb8342 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 13 Nov 2014 10:52:33 +0100 Subject: [PATCH] Patch for an Issue #929 --- lib/core/convert.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/core/convert.py b/lib/core/convert.py index 4f48de409..d0646e21b 100644 --- a/lib/core/convert.py +++ b/lib/core/convert.py @@ -41,6 +41,7 @@ def base64pickle(value): """ retVal = None + try: retVal = base64encode(pickle.dumps(value, pickle.HIGHEST_PROTOCOL)) except: @@ -63,7 +64,14 @@ def base64unpickle(value): 'foobar' """ - return pickle.loads(base64decode(value)) + retVal = None + + try: + retVal = pickle.loads(base64decode(value)) + except TypeError: + retVal = pickle.loads(base64decode(bytes(value))) + + return retVal def hexdecode(value): """