{"id":1854,"library":"pdbr","title":"pdbr: Pdb with Rich Library","description":"pdbr is a Python debugging tool that enhances the standard `pdb` (Python Debugger) by integrating the `Rich` library, providing colorful and well-formatted terminal output. It is currently at version 0.9.7 and sees active development with frequent releases addressing compatibility and adding features. It aims to make the debugging experience more visually appealing and user-friendly by leveraging Rich's capabilities for tracebacks, variable inspection, and more.","status":"active","version":"0.9.7","language":"en","source_language":"en","source_url":"https://github.com/cansarigol/pdbr","tags":["debugger","rich","pdb","cli","development","debugging"],"install":[{"cmd":"pip install pdbr","lang":"bash","label":"Install base package"},{"cmd":"pip install pdbr[ipython]","lang":"bash","label":"Install with IPython support"}],"dependencies":[{"reason":"Core functionality for colored output and enhanced display.","package":"rich","optional":false},{"reason":"Enables advanced features like magics and an improved shell experience within the debugger. Install via `pip install pdbr[ipython]`.","package":"ipython","optional":true}],"imports":[{"note":"This is the primary way to initiate a debugging session with pdbr.","symbol":"set_trace","correct":"import pdbr; pdbr.set_trace()"}],"quickstart":{"code":"import pdbr\n\ndef divide(a, b):\n    try:\n        result = a / b\n    except ZeroDivisionError:\n        print(\"Error: Division by zero detected, entering debugger...\")\n        pdbr.set_trace() # Program execution will pause here\n        result = 0\n    return result\n\nif __name__ == \"__main__\":\n    print(f\"10 / 2 = {divide(10, 2)}\")\n    print(f\"5 / 0 = {divide(5, 0)}\") # This call will trigger the debugger","lang":"python","description":"This example demonstrates how to insert a breakpoint using `pdbr.set_trace()`. When the `divide` function attempts division by zero, the debugger will be invoked, allowing interactive inspection of variables and program state."},"warnings":[{"fix":"Either `import pdbr` at the beginning of your script, or `os.environ[\"PYTHONBREAKPOINT\"] = \"pdbr.set_trace\"` before calling `breakpoint()`.","message":"When using Python's built-in `breakpoint()` function, ensure `pdbr` is imported beforehand, or set the `PYTHONBREAKPOINT` environment variable to `pdbr.set_trace` for `pdbr` to be activated. Otherwise, it will default to the standard `pdb`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `pdbr` to version 0.9.2 or newer when using IPython 9.x or later: `pip install --upgrade pdbr[ipython]`.","message":"Compatibility with IPython 9.x series was specifically addressed in `pdbr` version 0.9.2. Older `pdbr` versions may exhibit unexpected behavior or errors when used with IPython 9.x due to changes in IPython's internal architecture, especially regarding color and theme handling.","severity":"breaking","affected_versions":"<0.9.2"},{"fix":"Consult the `pdbr` documentation for the updated configuration file paths, typically moving to `~/.config/pdbr/` or similar XDG-compliant locations.","message":"Configuration file locations and parsing for `pdbr` (e.g., for history or context settings) were adjusted in version 0.8.9 to better adhere to `XDG_CONFIG_HOME`. If you have custom configurations, they might need to be relocated or updated.","severity":"gotcha","affected_versions":"<0.8.9"},{"fix":"For specific thread debugging, manually instantiate `pdbr.RichPdb()` for the target thread, then call its `set_trace()` method. Example: `my_debugger = pdbr.RichPdb(); my_debugger.set_trace()`.","message":"Like its base `pdb`, `pdbr` does not inherently handle multithreaded applications gracefully. Breakpoints in one thread may interrupt all threads. For more isolated debugging in multithreaded contexts, consider using `pdb.Pdb()` to create an isolated debugger instance and then call `set_trace()` on that specific object.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}