Skip to content

TrioEventLoop doesn't support subprocess_exec #97

Open
@ZeeD

Description

@ZeeD

I'm having NotImplementedError trying to run an asyncio-based library (chess) that run an external process with trio-asyncio.
It seems that subprocess_exec is not working as intended.
Minimal example that shows the error:

import trio
import trio_asyncio
import asyncio


async def main() -> None:
    async with trio_asyncio.open_loop() as loop:
        running_loop = asyncio.events.get_running_loop()
        assert loop is running_loop

        await loop.subprocess_exec(asyncio.SubprocessProtocol, 'dir')

trio.run(main)

the error:

Traceback (most recent call last):
  File "C:\Users\vito.detullio\Desktop\workspace-mystuff\moves\_dbg\minimal.py", line 13, in <module>
    trio.run(main)
  File "C:\Users\vito.detullio\Desktop\workspace-mystuff\moves_VENV\lib\site-packages\trio\_core\_run.py", line 1928, in run
    raise runner.main_task_outcome.error
  File "C:\Users\vito.detullio\Desktop\workspace-mystuff\moves\_dbg\minimal.py", line 11, in main
    await running_loop.subprocess_exec(asyncio.SubprocessProtocol, 'dir')
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 1615, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 487, in _make_subprocess_transport
    raise NotImplementedError
NotImplementedError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions