Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Easy Post Mortem Function

Open
#1,530 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
devtools

Research direction

Start by comparing Python's pdb.post_mortem behavior with the linked afterthought implementation and its use of debugpy. The issue names no debugpy files, tests, or entry points, so identify the appropriate integration surface and define the expected in-project API before implementation; done means the behavior is agreed and tested.

Written by the indexing model from the issue text.

Description

Hey Folks, feel free to close if this is not appropriate.

I am aware this has been brought up in different forms (https://github.com/microsoft/debugpy/issues?q=is%3Aissue+post+mortem+is%3Aclosed), but looking through the solutions, I never saw anything as simple as https://docs.python.org/3/library/pdb.html#pdb.post_mortem

So I created https://github.com/SharpSet/afterthought, which works pretty much as a direct equivalent to pdb.post_mortem, and uses debugpy behind the scenes with less than 30 lines of boilerplate.

import afterthought


def bombs():
    a = []
    print(a[0])


if __name__ == "__main__":
    try:
        bombs()
    except Exception as e:
        afterthought.debug(e)

I think it would make sense for this to exist within debugpy directly. If this is not of interest, I still would like to keep this issue here so people can see how I handled it. To the best of my knowledge I couldn't find anything this simple.

Thanks :))

Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.