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
IsolatedAsyncioTestCase and asyncio.run no-longer call asyncio.set_event_loop #93896
Comments
import sys
import asyncio
async def run_subprocess():
proc = await asyncio.create_subprocess_shell(
"exit 0",
stdin=asyncio.subprocess.DEVNULL,
stdout=asyncio.subprocess.DEVNULL,
stderr=asyncio.subprocess.DEVNULL,
)
await proc.wait()
print("success!")
async def amain():
await asyncio.to_thread(asyncio.run, run_subprocess())
def main():
asyncio.get_event_loop_policy().set_child_watcher(asyncio.SafeChildWatcher())
asyncio.run(amain())
if __name__ == "__main__":
sys.exit(main())
|
I know there were some efforts to deprecate |
alternatively is there still time to deprecate the child watchers system and the policy system in favor of that would be deprecating:
|
this is also broken with the PidfdChildWatcher |
in https://github.com/python/cpython/pull/31799/files#diff-1f2ae0f6c6010caf9d5f1c80cd6033a796ffe2b60554f5df84f554f4a08e622b the calls to
asyncio.set_event_loop()
were removed which breaks aiohttp aio-libs/aiohttp#6757 andasyncio.SafeChildWatcher
this looks like an intentional breaking change - and if it is should be documented
The text was updated successfully, but these errors were encountered: