Skip to content

Asyncio debugging tools no longer work (ps and pstree) #143952

Description

@johnslavik

Bug report

Bug description:

Since GH-142394 the asyncio debugging tools no longer work at all:

❯ ./python t.py
^Z
[1]+  Stopped                 ./python t.py

❯ jobs -l
[1]+ 873785 Stopped                 ./python t.py

❯ ./python -m asyncio ps 873785 |& tail -n 10
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 180, in build_task_table
    id2name, _, _ = _index(result)
                    ~~~~~~^^^^^^^^
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 49, in _index
    internal_stack = [_format_stack_entry(frame) for frame in call_stack]
                      ~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 30, in _format_stack_entry
    if elem.lineno == 0 and elem.filename == "":
       ^^^^^^^^^^^
AttributeError: '_remote_debugging.FrameInfo' object has no attribute 'lineno'

❯ ./python -m asyncio pstree 873785 |& tail -n 10
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 155, in build_async_tree
    id2name, awaits, task_stacks = _index(result)
                                   ~~~~~~^^^^^^^^
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 49, in _index
    internal_stack = [_format_stack_entry(frame) for frame in call_stack]
                      ~~~~~~~~~~~~~~~~~~~^^^^^^^
  File "/home/bswck/Python/cpython/main/Lib/asyncio/tools.py", line 30, in _format_stack_entry
    if elem.lineno == 0 and elem.filename == "":
       ^^^^^^^^^^^
AttributeError: '_remote_debugging.FrameInfo' object has no attribute 'lineno'

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    3.15bugs and security fixes
    on Jan 17, 2026
  2. changed the title [-]Asyncio tools no longer work (`ps` and `pstree`)[/-] [+]Asyncio debugging tools no longer work (`ps` and `pstree`)[/+] on Jan 17, 2026
  3. kumaraditya303 commented on Jan 17, 2026

    @kumaraditya303
    Contributor

    I am surprised that we do not have any tests for it, we should definitely add tests.

  4. johnslavik commented on Jan 17, 2026

    @johnslavik
    MemberAuthor

    Hm, I've gotten confused. We do have tests for tools.

  5. added a commit that references this issue on Jan 18, 2026
  6. moved this from Todo to Done in asyncioon Jan 18, 2026
  7. added a commit that references this issue on Feb 15, 2026
  8. added a commit that references this issue on Apr 13, 2026
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.15bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions