From 80a3b8d84f30351062bf47fc5779be33ddcfdafe Mon Sep 17 00:00:00 2001 From: Maarten Breddels Date: Sun, 20 Feb 2022 19:23:15 +0100 Subject: [PATCH] fix: wrong offset when memoryview format is non-byte the offset should be in bytes, not elements. See also https://github.com/bokeh/ipywidgets_bokeh/issues/46#issuecomment-1046292704 --- panel/io/ipywidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panel/io/ipywidget.py b/panel/io/ipywidget.py index 6d9f22f74c..f3121cee3c 100644 --- a/panel/io/ipywidget.py +++ b/panel/io/ipywidget.py @@ -28,7 +28,7 @@ def send(self, stream, msg_type, content=None, parent=None, ident=None, buffers= offsets = [start] for buffer in buffers[:-1]: - start += len(buffer) + start += memoryview(buffer).nbytes offsets.append(start) u32 = lambda n: n.to_bytes(4, "big")