Skip to content

Conversation

@rcollas
Copy link

@rcollas rcollas commented Nov 26, 2025

Summary

Updates the codebase to support Python 3.14 by removing the deprecated loop parameter from asyncio functions and replacing asyncio.ensure_future() with loop.create_task() where appropriate. Maintains backward compatibility with Python 3.9+.

Changes

Production Code

  • mode/services.py:

    • add_future(), _AwaitableService.on_start(): Use loop.create_task() for spawning new tasks
    • wait_many(), wait_first(), _wait_stopped(): Keep asyncio.ensure_future() (without loop param) to handle both coroutines and existing Tasks/Futures
  • mode/worker.py:

    • _schedule_shutdown(), execute_from_commandline(), _shutdown_loop(): Use loop.create_task()
  • mode/utils/logging.py:

    • flight_recorder.activate(): Use loop.create_task()

Fixes #4

@rcollas rcollas self-assigned this Nov 26, 2025
@rcollas rcollas marked this pull request as draft November 26, 2025 14:10
@rcollas rcollas closed this Nov 27, 2025
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.

Bug: ensure_future Usage Causes Python 3.14 Compatibility Break

3 participants