-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
Description
run_script(path) reads the script file from the host filesystem, not from inside the VM. This is counter-intuitive and undocumented — the docs show a pattern of creating a file inside the VM and then running it with run_script(), which fails.
Reproduction
import asyncio
import boxlite
async def main():
async with boxlite.CodeBox() as codebox:
# Create a script inside the VM
await codebox.run("""
with open('/tmp/analysis.py', 'w') as f:
f.write('import json\\nprint(json.dumps({"status": "ok"}))\\n')
""")
# Try to run the script from VM path
result = await codebox.run_script("/tmp/analysis.py")
print(result)
asyncio.run(main())Expected
run_script("/tmp/analysis.py") runs the script that was created inside the VM.
Actual
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/analysis.py'
The error occurs on the host side, confirming run_script() tries to read from host filesystem.
Environment
- boxlite 0.5.10
- macOS Apple Silicon
- Python 3.12
Suggested fix
Either:
- Make
run_script()read from inside the VM (consistent with the name), or - Clearly document that
run_script()reads from the host and sends content to the VM for execution
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels