Python-manhole

Access running Python applications for debugging. Connect via a Unix socket to view thread stacktraces and interact with the process using a REPL.

Visit Python-manhole

Provides an in-process service that accepts Unix domain socket connections for debugging live Python applications. Once connected, you get stacktraces for all threads and an interactive REPL prompt to inspect and interact with the running process.

It can operate in two main modes:

  • As a daemon thread, always listening for connections.
  • As a signal handler (using oneshot_on), pausing the application and waiting for a connection upon receiving a specific signal (e.g., USR1, USR2).

Key features include:

  • Secure access: Connection restricted to the application's effective user ID or root.
  • Simple setup: Install with pip install manhole and activate with manhole.install().
  • Fork-compatible: Automatically reinstalls after os.fork or os.forkpty (can be disabled).
  • Gevent/Eventlet support: Works with async frameworks (requires specific configuration).
  • Signal handling: Can activate the listening thread on a signal (activate_on) and masks signals in its own thread to avoid interference.
  • Flexible configuration: Options for socket path, activation signals, verbosity, and more.

Connect using tools like socat readline unix-connect:/tmp/manhole-<pid> for an enhanced debugging experience.

Categories:

Tags:

Share:
Featured tools:

Similar to Python-manhole:

IPython power for your Python debugging sessions.
DebuggingPython
Integrate IPython's enhanced features like tab completion, syntax highlighting, and better tracebacks into the standard Python debugger (pdb).
Visual Python debugging, right in your terminal.
DebuggingPython
Debug Python code visually within your console. Offers a lightweight, keyboard-driven interface with syntax highlighting, stack traces, and variable inspection.
Flexible toolkit for Python code tracing and debugging.
DebuggingPython
Trace Python code execution with powerful filters and custom actions. Debug, log, and inspect code behavior without complex setup or storage.
Visual profiler for Python
DebuggingProfiling+1 more
Python package providing rich and interactive visualizations for various Python program characteristics such as running time and memory usage.
Visualize and debug distributed workflows.
DebuggingTracing
Monitor and troubleshoot request flows across complex distributed systems. Identify bottlenecks, trace errors, and analyze service dependencies.
Profile live Python code safely, with minimal overhead.
DebuggingProfiling+1 more
Profile running Python programs with extremely low overhead. Visualize time spent without restarting or modifying code. Safe for production environments.

Command Menu