Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fe8bea commit 38c96a3Copy full SHA for 38c96a3
1 file changed
lib/core/convert.py
@@ -28,7 +28,16 @@ def base64encode(value):
28
return value.encode("base64")[:-1].replace("\n", "")
29
30
def base64pickle(value):
31
- return base64encode(pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
+ retVal = None
32
+ try:
33
+ retVal = base64encode(pickle.dumps(value, pickle.HIGHEST_PROTOCOL))
34
+ except:
35
+ warnMsg = "problem occurred while serializing "
36
+ warnMsg += "instance of a type '%s'" % type(value)
37
+ singleTimeWarnMessage(warnMsg)
38
+
39
+ retVal = base64encode(pickle.dumps(str(value), pickle.HIGHEST_PROTOCOL))
40
+ return retVal
41
42
def base64unpickle(value):
43
return pickle.loads(base64decode(value))
0 commit comments