mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Fix websocket/zmq serialization to expect memoryviews
This commit is contained in:
parent
10dcd71550
commit
d9d089759d
@ -43,6 +43,8 @@ def serialize_binary_message(msg):
|
||||
# don't modify msg or buffer list in-place
|
||||
msg = msg.copy()
|
||||
buffers = list(msg.pop('buffers'))
|
||||
# for python 2, copy the buffer memoryviews to byte strings
|
||||
buffers = [x.tobytes() for x in buffers]
|
||||
bmsg = json.dumps(msg, default=date_default).encode('utf8')
|
||||
buffers.insert(0, bmsg)
|
||||
nbufs = len(buffers)
|
||||
|
Loading…
Reference in New Issue
Block a user