Permalink
Browse files

fixed buffer serialization for buffers below threshold

  • Loading branch information...
1 parent 5cee18e commit 7992112349e0599b147b9aa9b03a5ba5ad58133e @minrk minrk committed Oct 15, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 IPython/zmq/newserialized.py
  2. +1 −1 IPython/zmq/parallel/streamsession.py
@@ -119,7 +119,7 @@ def _generateData(self):
elif self.typeDescriptor in ('bytes', 'buffer'):
self.data = self.obj
elif self.typeDescriptor == 'pickle':
- self.data = pickle.dumps(self.obj, 2)
+ self.data = pickle.dumps(self.obj, -1)
else:
raise SerializationError("Really wierd serialization error.")
del self.obj
@@ -160,7 +160,7 @@ def serialize_object(obj, threshold=64e-6):
clist = canSequence(obj)
slist = map(serialize, clist)
for s in slist:
- if s.getDataSize() > threshold:
+ if s.typeDescriptor in ('buffer', 'ndarray') or s.getDataSize() > threshold:
databuffers.append(s.getData())
s.data = None
return pickle.dumps(slist,-1), databuffers

0 comments on commit 7992112

Please sign in to comment.