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

Adapt to deprecation warnings in Python 3.14 alphas #3461

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

bdarnell
Copy link
Member

Python 3.14 deprecates the asyncio event loop policy system, so make (most of) the necessary changes.

The deprecation of set_event_loop is extremely disruptive to AsyncTestCase, so I've asked if it can remain undeprecated in python/cpython#130322. The testing.py changes are temporary until this is resolved.

Fixes #3458

Per comments, we needed to set and restore the event loop policy
in Python 3.4, but it no longer seems to be necessary (and
raises DeprecationWarnings in Python 3.14).
Accessing the base policy classes now triggers a deprecation warning
so we must use our own getattr hook to avoid it except when needed.
This causes deprecation warnings in Python 3.14
This is a temporary measure to get CI passing while the fate of these
deprecation warnings is decided in
python/cpython#130322
Alpha 5 has a bug that affects us, so pin alpha 4 until 6 is released.

python/cpython#130380
@bdarnell bdarnell merged commit bc5b923 into tornadoweb:master Feb 20, 2025
13 checks passed
@bdarnell bdarnell deleted the deprecations-314 branch February 20, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors caused by asyncio deprecation warning in full test workflow when using python 3.14.0-alpha.1
1 participant