-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrioEventLoop
doesn't support subprocess_exec
#97
Comments
Sorry that you're having this issue. The root cause is possibly #85 which is also a Windows-specific issue. Would you like to take a stab at it? |
To know if this is the same issue, can you try adding |
Hi. Thanks for you response. zed@FGVIL021718:/mnt/c/Users/vito.detullio/Desktop/workspace-mystuff/moves_VENV/Lib/site-packages/trio_asyncio$ grep -r 'add_signal_handler' .
./_base.py: def add_signal_handler(self, sig, callback, *args):
Binary file ./__pycache__/_base.cpython-38.pyc matches
$ I changed it following your suggestion but there is no difference in behavior |
Moreover if I try with a pure |
I had a quick look at the code and found simply that windows is "skipped": trio-asyncio/trio_asyncio/_base.py Lines 350 to 355 in 39f79e3
(there is no else )
|
Yeah, IIRC trio-asyncio's subprocess support is just broken on Windows. On Unix it mostly re-uses asyncio's native subprocess support with some hacks to make it play nicely with trio, which works OK because on Unix subprocesses mostly just need Probably the ideal solution would be to reimplement asyncio's subprocess API on top of trio's native subprocess API (which does exist now). It's more work because we have to implement our own subprocess transport etc., but OTOH it would mean that it works consistently across all platforms, and automatically take advantage of improvements in trio (e.g. using pidfd support when available). |
Another reason for the problem is that, while you did open a trio_asyncio loop, you're still in Trio context when you call |
@smurfix sorry, I tough that was "transparent" for the called code... I was looking at the examples on https://trio-asyncio.readthedocs.io/en/latest/usage.html#trio-main-loop |
Oops, that's an error. Will fix. |
I'm having
NotImplementedError
trying to run anasyncio
-based library (chess) that run an external process withtrio-asyncio
.It seems that
subprocess_exec
is not working as intended.Minimal example that shows the error:
the error:
The text was updated successfully, but these errors were encountered: