-
Notifications
You must be signed in to change notification settings - Fork 93
Closed
Description
Bug Description
SimpleBox.shutdown() calls self._box.shutdown(), but the underlying Rust Box object only exposes stop(), not shutdown(). This causes an AttributeError at runtime.
Reproduction
import asyncio, boxlite
async def main():
box = boxlite.SimpleBox(image="python:slim")
await box.start()
try:
result = await box.exec("echo", "hello")
print(result.stdout)
finally:
await box.shutdown()
asyncio.run(main())Expected: Box shuts down gracefully.
Actual:
AttributeError: 'builtins.Box' object has no attribute 'shutdown'
Root Cause
# simplebox.py
def shutdown(self):
self._box.shutdown() # ← Box only has stop(), not shutdown()The underlying Box object exposes: copy_in, copy_out, exec, id, info, metrics, name, start, stop — no shutdown.
Note
SimpleBoxalso does NOT have astop()method, so there is no working explicit cleanup method at all- The
async withcontext manager presumably works (calls something internally), but the manual lifecycle path is broken shutdown()is also a sync method but the docs showawait box.shutdown()(async call on sync method)
Fix
Either:
- Change
shutdown()to callself._box.stop(), or - Expose
stop()on SimpleBox as well
Environment
- boxlite 0.5.10
- Python 3.12.3
- macOS 15.6 (Apple Silicon)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels