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
gh-93896: restore the set_event_loop calls to asyncio.run #94058
base: main
Are you sure you want to change the base?
gh-93896: restore the set_event_loop calls to asyncio.run #94058
Conversation
if sys.platform == "win32": | ||
from .windows_events import ProactorEventLoop as _new_event_loop | ||
else: | ||
from .unix_events import SelectorEventLoop as _new_event_loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this opts asyncio.Runner out of the policy system and asyncio.run opts back in
f21f808
to
abbd6b4
Compare
If set_policy_loop is True, the event loop in the default policy will be | ||
set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is classified as a bug (clearly it is causing issues), then fixing it shouldn't be blocking. By only implementing this behind an argument we are introducing a new feature which means that this will only be added to 3.12 (and not 3.11).
I would vote for not adding this argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's important to maintain the asyncio.Runner support for a high level policy-free use of asyncio, so that the policy system can be deprecated and removed
This function always creates a new event loop from the default policy sets | ||
it in the event loop policy and closes it at the end and sets the policy | ||
loop to None. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This long sentence is quite wordy and without knowing the change I would probably not understand what it means.
I would probably suggest not making this change (referring to this very sentence). To most, setting the loop in the event loop policy is probably synonymous to actually creating and running a loop.
Misc/NEWS.d/next/Library/2022-06-21-13-08-46.gh-issue-93896.2BsYCX.rst
Outdated
Show resolved
Hide resolved
…sYCX.rst Co-authored-by: Bluenix <bluenixdev@gmail.com>
Fixes #93896