Open yurivict opened 5 days ago
hasattr(select, "kqueue")
must be False for that to be False fwiw
When I run it separately, hasattr(select, "kqueue")
evaluates to True.
I don't know how can that be.
Yeah, because eventlet patches out select.kqueue. If you import trio first things should work... we should probably make the error message better.
It shouldn't fail like this. This failure is very obscure. I accidentally caught this while testing wandb after having other things installed by something else.
Would this as an error message work better?: "unsupported platform or the IO primitives trio relies on are patched out" if either eventlet or gevent are detected in sys.modules?
I guess this error message is okay.
The real problem seems to lie in the eventlet package. It fails like this on import.
This is because eventlet does some nasty monkeypatching stuff and replaces signal handlers with its own
When both wandb and eventlet packages are installed 'import wandb' fails in the trio code:
The conditional in this line:
always evaluates to False because
TYPE_CHECKING
is always False at run-time. Otherwisehasattr(select, "kqueue")
evaluates to True.Version: 0.26.2 Python-3.11 FreeBSD 14.1