GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created by serhiy-storchaka · Pull Request #99949 · python/cpython

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Dec 2, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

It no longer emits a deprecation warning if the current event loop was set.

  • Issue: Finish deprecation in asyncio.get_event_loop() #93453

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka
pythongh-93453: Only emit deprecation warning in asyncio.get_event_lo…
28c7d02
…op when a new event loop is created

It no longer emits a deprecation warning if the current event loop was set.
@serhiy-storchaka
serhiy-storchaka requested review from 1st1, asvetlov and gvanrossum December 2, 2022 11:08
@bedevere-bot bedevere-bot mentioned this pull request Dec 2, 2022
Finish deprecation in asyncio.get_event_loop() #93453
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Dec 2, 2022
@serhiy-storchaka serhiy-storchaka changed the title gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created [3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created Dec 2, 2022
@serhiy-storchaka serhiy-storchaka mentioned this pull request Dec 2, 2022
gh-93453: No longer create an event loop in get_event_loop() #98440
Merged
@ambv
Merge branch '3.11' into asyncio-get_event_loop2-3.11
c6cbcb9
@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

This will need to also be backported to 3.10. In the light of that, I'm nervous about the removal of _asyncio._get_event_loop here. The point of the change as named in the PR is to stop emitting deprecation warnings when a loop exists on the policy. Serhiy's comment here explains this intent as well:
#98440 (comment)

@serhiy-storchaka, @gvanrossum, @kumaraditya303: would you be okay if I changed this PR to keep _asyncio._get_event_loop intact? I think that makes more sense for a change that's supposed to land in 3.10.9 too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Note that I'm fine with _get_event_loop() to disappear in 3.12 as it's an underscored name. I simply think it's going to be disruptive to change this in 3.11.1 and 3.10.9.

(I also resolved a conflict in any case to have CI green.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
Restore asyncio._get_event_loop().
a7a2804
@serhiy-storchaka

serhiy-storchaka commented Dec 5, 2022

Copy link
Copy Markdown
Member Author

I do not think it is necessary, but I have no objections.

ambv and gvanrossum reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka commented Dec 5, 2022
View reviewed changes
Comment thread Modules/_asynciomodule.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

OK, @serhiy-storchaka, then I'll adapt this PR to leave _asyncio._get_event_loop existing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gvanrossum
gvanrossum approved these changes Dec 6, 2022
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

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.

Do read my comments first!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/library/asyncio-eventloop.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/asyncio-policy.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/asyncio/events.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Dec 6, 2022
serhiy-storchaka added 2 commits December 6, 2022 12:38
@serhiy-storchaka
Address review comments.
85d3c36
@serhiy-storchaka
Merge branch '3.11' into asyncio-get_event_loop2-3.11
8d5072b
@serhiy-storchaka

serhiy-storchaka commented Dec 6, 2022

Copy link
Copy Markdown
Member Author

I afraid that I can create conflicts with Łukasz, so from now I'm stopping committing in this branch. In any case my internet connection is currently too bad and can disappear at any time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv
Revert removal of asyncio.events._get_event_loop and _asyncio._get_ev…
199433c
…ent_loop
@ambv

ambv commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Thanks, @serhiy-storchaka, I reverted removal of asyncio.events._get_event_loop and _asyncio._get_event_loop. Look how obvious the remaining changes now look in the "Files changed" tab. I like this.

I will wait for everything to pass and then merge this to create a 3.10 backport.

serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ambv ambv added the needs backport to 3.10 label Dec 6, 2022
@ambv
ambv merged commit 3fae04b into python:3.11 Dec 6, 2022
@miss-islington

miss-islington commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting merge label Dec 6, 2022
@miss-islington

miss-islington commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Sorry @serhiy-storchaka and @ambv, I had trouble checking out the 3.10 backport branch.
Please retry by removing and re-adding the "needs backport to 3.10" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 3fae04b10e2655a20a3aadb5e0d63e87206d0c67 3.10

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned ambv Dec 6, 2022
@ambv

ambv commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Note: I'm working on the backport now manually, there's some test conflicts with 3.10.

Now backporting '3fae04b10e2655a20a3aadb5e0d63e87206d0c67' into '3.10'
Error cherry-pick 3fae04b10e2655a20a3aadb5e0d63e87206d0c67.
Auto-merging Doc/library/asyncio-eventloop.rst
Auto-merging Doc/library/asyncio-llapi-index.rst
Auto-merging Lib/asyncio/events.py
Auto-merging Lib/test/test_asyncio/test_base_events.py
Auto-merging Lib/test/test_asyncio/test_events.py
CONFLICT (content): Merge conflict in Lib/test/test_asyncio/test_events.py
Auto-merging Lib/test/test_asyncio/test_futures.py
CONFLICT (content): Merge conflict in Lib/test/test_asyncio/test_futures.py
Auto-merging Lib/test/test_asyncio/test_streams.py
CONFLICT (content): Merge conflict in Lib/test/test_asyncio/test_streams.py
Auto-merging Lib/test/test_asyncio/test_tasks.py
CONFLICT (content): Merge conflict in Lib/test/test_asyncio/test_tasks.py
Auto-merging Lib/test/test_coroutines.py
Auto-merging Modules/_asynciomodule.c
error: could not apply 3fae04b10e... [3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created (#99949)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ambv pushed a commit to ambv/cpython that referenced this pull request Dec 6, 2022
@serhiy-storchaka @ambv
[3.10] [3.11] pythongh-93453: Only emit deprecation warning in asynci…
41e6a4c
…o.get_event_loop when a new event loop is created (pythonGH-99949)

It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 3fae04b)

Co-authored-by: Serhiy Storchaka <[email protected]>
@blink1073 blink1073 mentioned this pull request Jun 14, 2023
Clean up event loop handling miguelgrinberg/greenletio#11
Closed
@ZeroIntensity ZeroIntensity removed the needs backport to 3.10 label Feb 17, 2025
@serhiy-storchaka
serhiy-storchaka deleted the asyncio-get_event_loop2-3.11 branch July 1, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ambv ambv ambv left review comments
@gvanrossum gvanrossum gvanrossum approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ambv ambv

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@serhiy-storchaka @ambv @miss-islington @gvanrossum @bedevere-bot @ZeroIntensity
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.