logoalt Hacker News

vimotatoday at 6:48 PM1 replyview on HN

Simon - would love if you could take a look at Localsandbox (https://github.com/coplane/localsandbox) - it was partly inspired by your Pyodide post!


Replies

simonwtoday at 7:04 PM

I 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!
show 1 reply