Skip to content

Commit efd9b1d

Browse files
committed
[jupyter] forbid JSROOT files browsing bigger than 300 MB
1 parent 5f69620 commit efd9b1d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers

bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,10 @@ def _getFileJsCode(self):
574574
return f"File version {f.GetVersion()} is too old and not supported by JSROOT"
575575

576576
sz = f.GetSize()
577+
if sz > 300000000:
578+
return f"File size {sz} is too large for JSROOT display."
577579
if sz > 10000000 and not self.drawForce:
578-
return f"File size {sz} is too large for JSROOT display. Use '-f' flag like '%rootbrowse {self.drawFileName} -f' to show file nevertheless"
580+
return f"File size {sz} is large for JSROOT display. Use '-f' flag like '%rootbrowse {self.drawFileName} -f' to show file nevertheless"
579581

580582
# create plain buffer and get pointer on it
581583
u_buffer = (ctypes.c_ubyte * sz)(*range(sz))

0 commit comments

Comments
 (0)