Commit 3424a562 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix issue with pickling and python3

parent aa341e2e
......@@ -52,7 +52,10 @@ def IStream_readline(self, n=None):
def OStream_write(self, s):
self.Write(s, len(s))
data = s
if not isinstance(data, str) and isinstance(data, bytes):
data = data.decode('utf-8')
self.Write(data, len(s)) = IStream_read
libgraph_tool_core.IStream.readline = IStream_readline
......@@ -63,11 +66,11 @@ libgraph_tool_core.OStream.write = OStream_write
def pickler(stream, obj):
sstream = BytesIO()
pickle.dump(obj, sstream, -1)
def unpickler(stream):
sstream = BytesIO(base64.b64decode('ascii')))
data ='utf-8')
sstream = BytesIO(base64.b64decode(data))
return pickle.load(sstream)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment