Description
cwsandbox/_cleanup.py calls _install_handlers() at module load, which calls signal.signal(). That only works on the main thread, so simply importing cwsandbox from a worker thread crashes with ValueError: signal only works in main thread of the main interpreter.
import threading
threading.Thread(target=lambda: __import__("cwsandbox")).start()
# ValueError: signal only works in main thread of the main interpreter
marimo executes the with app.setup: block from a worker thread, so any marimo notebook that imports cwsandbox in setup fails before the first cell renders.
This is not a hard blocker. For now I have a workaround in my marimo notebook that catches the ValueError and restores the original just wanted to file this in case it impacts others
Steps to reproduce
import marimo
app = marimo.App()
with app.setup:
from cwsandbox import Sandbox
Expected behavior
Import should succeed.
Actual behavior
ValueError: signal only works in main thread of the main interpreter
cwsandbox version
0.24.0
Python version
3.13.9
Operating system
No response
Additional context
No response
Description
cwsandbox/_cleanup.pycalls_install_handlers()at module load, which callssignal.signal(). That only works on the main thread, so simply importingcwsandboxfrom a worker thread crashes withValueError: signal only works in main thread of the main interpreter.marimo executes the with
app.setup:block from a worker thread, so any marimo notebook that imports cwsandbox in setup fails before the first cell renders.This is not a hard blocker. For now I have a workaround in my marimo notebook that catches the ValueError and restores the original just wanted to file this in case it impacts others
Steps to reproduce
Expected behavior
Import should succeed.
Actual behavior
ValueError: signal only works in main thread of the main interpretercwsandbox version
0.24.0
Python version
3.13.9
Operating system
No response
Additional context
No response