5 ms·
Simon - would love if you could take a look at Localsandbox (https://github.com/coplane/localsandbox https://github.com/coplane/localsandbox) - it was partly in
by vimota 8mo ago
Simon - would love if you could take a look at Localsandbox (https://github.com/coplane/localsandbox https://github.com/coplane/localsandbox) - it was partly inspired by your Pyodide post!
- simonw 8mo agoI tried it (really like the API design) but ran into a blocker: uv run --with localsandbox python -c ' from localsandbox import LocalSandbox with LocalSandbox() as sandbox: result = sandbox.bash("echo hi") print(result.stdout) ' Gave me: Traceback (most recent call last): File "<string>", line 5, in <module> result = sandbox.bash("echo hi") File "/Users/simon/.cache/uv/archive-v0/spFCEHagkq3VTpTyStT-Z/lib/python3.14/site-packages/localsandbox/core.py", line 492, in bash raise SubprocessCrashed( ...<2 lines>... ) localsandbox.exceptions.SubprocessCrashed: Node subprocess crashed: error: Failed reading lockfile at '/Users/simon/.cache/uv/archive-v0/spFCEHagkq3VTpTyStT-Z/lib/python3.14/site-packages/localsandbox/shim/deno.lock' Caused by: Unsupported lockfile version '5'. Try upgrading Deno or recreating the lockfile Actually that was with Deno 2.2.10 - I ran "brew upgrade deno" and got Deno 2.6.7 and now it works!
- simonw 8mo agoIt looks like it currently defaults to allowing networking so it can load Pyodide from npm. My preference is a sandbox with no network access at all and access only to specific files that I can configure.
- vimota 8mo agoThanks for taking a look and the feedback! We run the shim with internet access (https://github.com/coplane/localsandbox/blob/main/localsandbox/shim/deno.json#L7 https://github.com/coplane/localsandbox/blob/main/localsandb...) but the pyodide sandbox itself doesn't run with internet access : https://github.com/coplane/localsandbox/blob/main/localsandbox/shim/src/python.ts#L139 https://github.com/coplane/localsandbox/blob/main/localsandb...
- simonw 8mo agoOh neat, thanks - I'd missed that.