← 返回首页
deprecate the asyncio child watchers system · Issue #94597 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

deprecate the asyncio child watchers system #94597

New issue
New issue

Description

Deprecate the child watchers system and the policy system in favour of
asyncio.Runner(loop_factory=asyncio.ProactorEventLoop/asyncio.SelectorEventLoop/uvloop.new_event_loop)
that would be deprecating:

asyncio.get_event_loop() # already deprecated unless the loop is running asyncio.set_event_loop() # asyncio.set_event_loop(None) should probably be exempt asyncio.get_event_loop_policy() asyncio.set_event_loop_policy() # asyncio.set_event_loop_policy(None) should probably be exempt asyncio.set_child_watcher() asyncio.get_child_watcher() # `_make_subprocess_transport` will instead attempt to use os.open_pidfd and fallback to starting a thread

I'd also like to introduce a new API: asyncio.EventLoop implemented as:

if sys.platform == "win32": EventLoop = ProactorEventLoop else: EventLoop = SelectorEventLoop

asyncio.new_event_loop() will issue a DeprecationWarning if the current policy is not the default policy, and then in 3 releases become an alias of asyncio.EventLoop

Originally posted by @graingert in #93896 (comment)

Metadata

Metadata

Labels

3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-asyncio

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

  • Open in GitHub Copilot app

Footer

© 2026 GitHub, Inc.