Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugger: load 'ipdb' if present #2342

Merged
merged 3 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion datasette/handle_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
)
from .views.base import DatasetteError
from markupsafe import Markup
import pdb
import traceback

try:
import ipdb as pdb
except ImportError:
import pdb

try:
import rich
except ImportError:
Expand Down
8 changes: 6 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ Debugging

Any errors that occur while Datasette is running while display a stack trace on the console.

You can tell Datasette to open an interactive ``pdb`` debugger session if an error occurs using the ``--pdb`` option::
You can tell Datasette to open an interactive ``pdb`` (or ``ipdb``, if present) debugger session if an error occurs using the ``--pdb`` option::

datasette --pdb fixtures.db

For `ipdb <https://pypi.org/project/ipdb/>`__, first run this::

datasette install ipdb

.. _contributing_formatting:

Code formatting
Expand Down Expand Up @@ -349,4 +353,4 @@ Datasette bundles `CodeMirror <https://codemirror.net/>`__ for the SQL editing i
-p @rollup/plugin-node-resolve \
-p @rollup/plugin-terser

* Update the version reference in the ``codemirror.html`` template.
* Update the version reference in the ``codemirror.html`` template.
Loading