Skip to content

The asyncio REPL does not manage the event loop properly #142784

Description

@johnslavik

Bug report

Bug description:

Most importantly, it doesn't call .close() on it, which blocks GH-140288 and causes surprising warnings on Windows (see GH-141262).

Ideally, we'd employ asyncio.Runner to manage the tricky and ever-changing parts of the lifecycle pipeline correctly.

CC @ZeroIntensity stdlib, topic-repl, topic-asyncio, 3.13, 3.14, 3.15

CPython versions tested on:

CPython main branch, 3.15, 3.14, 3.13

Operating systems tested on:

Linux, Windows, macOS

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Dec 16, 2025
  2. added
    3.13only security fixes
    3.14bugs and security fixes
    3.15bugs and security fixes
    on Dec 16, 2025
  3. kumaraditya303 commented on Dec 17, 2025

    @kumaraditya303
    Contributor

    I think the simpler change is to just call loop.close, asyncio.Runner feels overkill for this.

  4. johnslavik commented on Dec 18, 2025

    @johnslavik
    MemberAuthor

    I think the simpler change is to just call loop.close, asyncio.Runner feels overkill for this.

    Sure. If we ever need a runner, we can add it later. 👍

  5. added a commit that references this issue on Dec 18, 2025
  6. added 2 commits that reference this issue on Dec 18, 2025
  7. added 2 commits that reference this issue on Dec 18, 2025
  8. moved this from Todo to Done in asyncioon Dec 18, 2025
  9. added a commit that references this issue on Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixes3.14bugs and security fixes3.15bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-asynciotopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions