Skip to content

Faulthandler output should include the thread name #125434

Open
@spacemanspiff2007

Description

@spacemanspiff2007

Feature or enhancement

Proposal:

Currently faulthandler just dumps the thread id.
It would be nice if the thread name would also be part of the output since this makes debugging much easier

Current output

Thread 0x00003b9c (most recent call first):
  File "C:\ProgramFiles\Python\Python312\Lib\concurrent\futures\thread.py", line 89 in _worker
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1012 in run
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1075 in _bootstrap_inner
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1032 in _bootstrap
...

Better output with thread name in square brackets

Thread 0x00003b9c [Thread pool worker 1] (most recent call first):
  File "C:\ProgramFiles\Python\Python312\Lib\concurrent\futures\thread.py", line 89 in _worker
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1012 in run
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1075 in _bootstrap_inner
  File "C:\ProgramFiles\Python\Python312\Lib\threading.py", line 1032 in _bootstrap
...

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions