{"id":13501448,"url":"https://github.com/ionelmc/python-remote-pdb","last_synced_at":"2025-04-12T19:52:23.586Z","repository":{"id":14178636,"uuid":"16884822","full_name":"ionelmc/python-remote-pdb","owner":"ionelmc","description":"Remote vanilla PDB (over TCP sockets).","archived":false,"fork":false,"pushed_at":"2022-10-24T05:33:43.000Z","size":105,"stargazers_count":261,"open_issues_count":9,"forks_count":29,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-09T08:51:13.787Z","etag":null,"topics":["debugging","pdb","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ionelmc.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-16T12:58:19.000Z","updated_at":"2024-04-23T20:40:53.000Z","dependencies_parsed_at":"2022-07-10T00:16:38.885Z","dependency_job_id":null,"html_url":"https://github.com/ionelmc/python-remote-pdb","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionelmc%2Fpython-remote-pdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionelmc%2Fpython-remote-pdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionelmc%2Fpython-remote-pdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionelmc%2Fpython-remote-pdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ionelmc","download_url":"https://codeload.github.com/ionelmc/python-remote-pdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625501,"owners_count":21135513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging","pdb","python"],"created_at":"2024-07-31T22:01:38.023Z","updated_at":"2025-04-12T19:52:23.561Z","avatar_url":"https://github.com/ionelmc.png","language":"Python","readme":"========\nOverview\n========\n\n.. start-badges\n\n.. list-table::\n    :stub-columns: 1\n\n    * - docs\n      - |docs|\n    * - tests\n      - | |github-actions| |requires|\n        | |coveralls| |codecov|\n    * - package\n      - | |version| |wheel| |supported-versions| |supported-implementations|\n        | |commits-since|\n.. |docs| image:: https://readthedocs.org/projects/python-remote-pdb/badge/?style=flat\n    :target: https://python-remote-pdb.readthedocs.io/\n    :alt: Documentation Status\n\n.. |github-actions| image:: https://github.com/ionelmc/python-remote-pdb/actions/workflows/github-actions.yml/badge.svg\n    :alt: GitHub Actions Build Status\n    :target: https://github.com/ionelmc/python-remote-pdb/actions\n\n.. |requires| image:: https://requires.io/github/ionelmc/python-remote-pdb/requirements.svg?branch=main\n    :alt: Requirements Status\n    :target: https://requires.io/github/ionelmc/python-remote-pdb/requirements/?branch=main\n\n.. |coveralls| image:: https://coveralls.io/repos/ionelmc/python-remote-pdb/badge.svg?branch=main\u0026service=github\n    :alt: Coverage Status\n    :target: https://coveralls.io/r/ionelmc/python-remote-pdb\n\n.. |codecov| image:: https://codecov.io/gh/ionelmc/python-remote-pdb/branch/main/graphs/badge.svg?branch=main\n    :alt: Coverage Status\n    :target: https://codecov.io/github/ionelmc/python-remote-pdb\n\n.. |version| image:: https://img.shields.io/pypi/v/remote-pdb.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.org/project/remote-pdb\n\n.. |wheel| image:: https://img.shields.io/pypi/wheel/remote-pdb.svg\n    :alt: PyPI Wheel\n    :target: https://pypi.org/project/remote-pdb\n\n.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/remote-pdb.svg\n    :alt: Supported versions\n    :target: https://pypi.org/project/remote-pdb\n\n.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/remote-pdb.svg\n    :alt: Supported implementations\n    :target: https://pypi.org/project/remote-pdb\n\n.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-remote-pdb/v2.1.0.svg\n    :alt: Commits since latest release\n    :target: https://github.com/ionelmc/python-remote-pdb/compare/v2.1.0...main\n\n\n\n.. end-badges\n\nRemote vanilla PDB (over TCP sockets) *done right*: no extras, proper handling around connection failures and CI. Based\non `pdbx \u003chttps://pypi.python.org/pypi/pdbx\u003e`_.\n\n* Free software: BSD 2-Clause License\n\nInstallation\n============\n\n::\n\n    pip install remote-pdb\n\nUsage\n=====\n\nTo open a remote PDB on first available port:\n\n.. code:: python\n\n    from remote_pdb import set_trace\n    set_trace() # you'll see the port number in the logs\n\nTo use some specific host/port:\n\n.. code:: python\n\n    from remote_pdb import RemotePdb\n    RemotePdb('127.0.0.1', 4444).set_trace()\n\nTo connect just run ``telnet 127.0.0.1 4444``.  When you are finished\ndebugging, either exit the debugger, or press Control-], then Control-d.\n\nAlternately, one can connect with NetCat: ``nc -C 127.0.0.1 4444`` or Socat: ``socat readline\ntcp:127.0.0.1:4444`` (for line editing and history support).  When finished debugging, either exit\nthe debugger, or press Control-c.\n\nNote that newer Ubuntu disabled readline support in socat, so if you get\n``unknown device/address \"readline\"`` try using rlwrap like this::\n\n    rlwrap socat - tcp:127.0.0.1:4444\n\nUsing in containers\n===================\n\nIf you want to connect from the host to remote-pdb running inside the container you should make sure that:\n\n* The port you will use is mapped (eg: ``-p 4444:4444``).\n* The host is set to ``0.0.0.0`` (``localhost` or ``127.0.0.1`` will not work because\n  Docker doesn't map the port on the local interface).\n\nIntegration with breakpoint() in Python 3.7+\n============================================\n\nIf you are using Python 3.7 one can use the new ``breakpoint()`` built in to invoke\nremote PDB. In this case the following environment variable must be set:\n\n.. code:: bash\n\n    PYTHONBREAKPOINT=remote_pdb.set_trace\n\nThe debugger can then be invoked as follows, without any imports:\n\n.. code:: python\n\n    breakpoint()\n\nAs the ``breakpoint()`` function does not take any arguments, environment variables can be used to\nspecify the host and port that the server should listen to. For example, to run ``script.py`` in such a\nway as to make ``telnet 127.0.0.1 4444`` the correct way of connecting, one would run:\n\n.. code:: bash\n\n    PYTHONBREAKPOINT=remote_pdb.set_trace REMOTE_PDB_HOST=127.0.0.1 REMOTE_PDB_PORT=4444 python script.py\n\nIf ``REMOTE_PDB_HOST`` is omitted then a default value of 127.0.0.1 will be used. If ``REMOTE_PDB_PORT`` is\nomitted then the first available port will be used. The connection information will be logged to the console,\nas with calls to ``remote_pdb.set_trace()``.\n\nTo quiet the output, set ``REMOTE_PDB_QUIET=1``, this will prevent\n``RemotePdb`` from producing any output -- you'll probably want to specify\n``REMOTE_PDB_PORT`` as well since the randomized port won't be printed.\n\n\nNote about OS X\n===============\n\nIn certain scenarios (backgrounded processes) OS X will prevent readline to be imported (and readline is a dependency of pdb).\nA workaround (run this early):\n\n.. code:: python\n\n    import signal\n    signal.signal(signal.SIGTTOU, signal.SIG_IGN)\n\nSee `#9 \u003chttps://github.com/ionelmc/python-remote-pdb/issues/9\u003e`_ and `cpython#14892 \u003chttp://bugs.python.org/issue14892\u003e`_.\n\nRequirements\n============\n\nPython 2.6, 2.7, 3.2, 3.3 and PyPy are supported.\n\nSimilar projects\n================\n\n* `qdb \u003chttps://pypi.python.org/pypi/qdb\u003e`_\n","funding_links":[],"categories":["Debugging Tools","Python","Awesome Python"],"sub_categories":["Debugging Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionelmc%2Fpython-remote-pdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionelmc%2Fpython-remote-pdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionelmc%2Fpython-remote-pdb/lists"}