-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-asyncio
Description
Documentation
This page states: https://docs.python.org/3/library/asyncio-dev.html#concurrency-and-multithreading
To handle signals and to execute subprocesses, the event loop must be run in the main thread.
For me this means that if I want to use subprocess call my async function must be triggered by loop on the main thread. In other words async functions can not call subprocess when running in child thread.
However this page states: https://docs.python.org/3/library/asyncio-subprocess.html#subprocess-and-threads
Standard asyncio event loop supports running subprocesses from different threads by default.
To me this means that I can spawn a child thread, call async function inside it, and that async function is free to call subprocess without problems.
Linked PRs
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtopic-asyncio
Projects
Status
Done