Skip to content

Enhancement: Using installed debugger post mortem #3949

@cansarigol

Description

@cansarigol

Summary

First of all, thank you all for this amazing project. I was wondering if you guys consider replacing pdb.post_mortem with a debugger package of already installed ones. This way, we can continue with the terminals we are used to.

In my mind, it is something like this:

middleware/_internal/init.py :

def get_post_mortem():
    for package in ["pdbr", "pudb", "ipdb", "pdbpp"]:
        try:
            module = __import__(package, fromlist=["post_mortem"])
            return module.post_mortem
        except ImportError:
            continue

     
    import pdb
    return pdb.post_mortem

middleware/_internal/exceptions/middleware.py :

if litestar_app.pdb_on_exception:
    from .. import get_post_mortem
    get_post_mortem()()

Basic Example

image

Drawbacks and Impact

No response

Unresolved questions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementThis is a new feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions