Skip to content
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

[3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() #100412

Open
wants to merge 4 commits into
base: 3.11
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 21, 2022

They are deferred to Python 3.12.

@serhiy-storchaka serhiy-storchaka requested a review from ambv Dec 21, 2022
@gvanrossum gvanrossum changed the title gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() gh-100160: [3.11] Remove any deprecation warnings in asyncio.get_event_loop() Dec 21, 2022
@gvanrossum gvanrossum changed the title gh-100160: [3.11] Remove any deprecation warnings in asyncio.get_event_loop() [3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() Dec 21, 2022
Copy link
Member

@gvanrossum gvanrossum left a comment

Obv. this is a draft PR so this review is also a draft. :-)

.. deprecated:: 3.10
Deprecation warning is emitted if there is no current event loop.
In Python 3.12 it will be an error.

.. note::
In Python versions 3.10.0--3.10.8 and 3.11.0 this function
(and other functions which used it implicitly) emitted a
:exc:`DeprecationWarning` if there was no running event loop, even if
the current loop was set.

Copy link
Member

@gvanrossum gvanrossum Dec 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the stormy history of deprecations here, maybe add a note indicating which versions emit deprecation warnings under which circumstances? I think it might be:

  • 3.10.0-3.10.8, 3.11.0: warn if there is no running event loop
  • 3.10.9, 3.11.1: warn if there's no running AND no current event loop
  • 3.10.10+, 3.11.2+: no warning, may create new loop OR raise RuntimeError if there's no running and no current loop
  • 3.12, 3.13: warning if it creates a new loop
  • 3.14: error instead of creating a new loop

(Am I right about all that?)

Also in the next file.

@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review Dec 22, 2022
@serhiy-storchaka
Copy link
Member Author

serhiy-storchaka commented Dec 22, 2022

Thank you for your review Guido. I switched it to draft to be sure that it will not be accidentally merged.

The hard part in these PRs (#100410 and #100412) is documentation. It is difficult to find good place where all this mess should be documented, and I am bad in writing English. I think that non-documentation part is ready, but I am not sure about the documentation. Fill free to commit directly to this branch or create a new PR based on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants