rpdb


Namerpdb JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttp://tamentis.com/projects/rpdb
Summarypdb wrapper with remote access via tcp socket
upload_time2024-12-26 18:13:17
maintainerNone
docs_urlNone
authorBertrand Janin
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rpdb - remote debugger based on pdb

rpdb is a wrapper around pdb that re-routes stdin and stdout to a socket
handler. By default it opens the debugger on port 4444:

```python
import rpdb; rpdb.set_trace()
```

But you can change that by simply instantiating Rpdb manually:

```python
import rpdb
debugger = rpdb.Rpdb(port=12345)
debugger.set_trace()
```

It is known to work on Jython 2.5 to 2.7, Python 2.5 to 3.1. It was written
originally for Jython since this is pretty much the only way to debug it when
running it on Tomcat.

Upon reaching `set_trace()`, your script will "hang" and the only way to get it
to continue is to access rpdb using telnet, netcat, etc..:

```shell
nc 127.0.0.1 4444
```

## Installation in CPython (standard Python)

```shell
pip install rpdb
```

For a quick, ad hoc alternative, you can copy the entire rpdb subdirectory
(the directory directly containing the __init__.py file) to somewhere on your
`$PYTHONPATH`.

## Installation in a Tomcat webapp

Just copy the rpdb directory (the one with the __init__.py file) in your
WEB-INF/lib/Lib folder along with the standard Jython library (required).

## Trigger rpdb with signal

`set_trace()` can be triggered at any time by using the TRAP signal handler.
This allows you to debug a running process independently of a specific failure
or breakpoint:

```python
import rpdb
rpdb.handle_trap()

# As with set_trace, you can optionally specify addr and port
rpdb.handle_trap("0.0.0.0", 54321)
```

Calling `handle_trap` will overwrite the existing handler for SIGTRAP if one has
already been defined in your application.

## Known bugs

- The socket is not always closed properly so you will need to ^C in netcat
  and Esc+q in telnet to exit after a continue or quit.
- There is a bug in Jython 2.5/pdb that causes rpdb to stop on ghost
  breakpoints after you continue ('c'), this is fixed in 2.7b1.

## Author(s)

Bertrand Janin <b@janin.com> - http://tamentis.com/

With contributions from (chronological, latest first):

- Cameron Davidson-Pilon - @CamDavidsonPilon
- Pavel Fux - @fuxpavel
- Ken Manheimer - @kenmanheimer
- Steven Willis - @onlynone
- Jorge Niedbalski R <niedbalski@gmail.com>
- Cyprien Le Pannérer <clepannerer@edd.fr>
- k4ml <kamal.mustafa@gmail.com>
- Sean M. Collins <sean@coreitpro.com>
- Sean Myers <sean.myers@redhat.com>

This is inspired by:

- http://bugs.python.org/issue721464
- http://snippets.dzone.com/posts/show/7248
            

Raw data

            {
    "_id": null,
    "home_page": "http://tamentis.com/projects/rpdb",
    "name": "rpdb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Bertrand Janin",
    "author_email": "b@janin.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/87/2dc67e3d5a005173b2e4165bdfdeb302ef38393b16312afe70f7a252f3ae/rpdb-0.2.0.tar.gz",
    "platform": null,
    "description": "# rpdb - remote debugger based on pdb\n\nrpdb is a wrapper around pdb that re-routes stdin and stdout to a socket\nhandler. By default it opens the debugger on port 4444:\n\n```python\nimport rpdb; rpdb.set_trace()\n```\n\nBut you can change that by simply instantiating Rpdb manually:\n\n```python\nimport rpdb\ndebugger = rpdb.Rpdb(port=12345)\ndebugger.set_trace()\n```\n\nIt is known to work on Jython 2.5 to 2.7, Python 2.5 to 3.1. It was written\noriginally for Jython since this is pretty much the only way to debug it when\nrunning it on Tomcat.\n\nUpon reaching `set_trace()`, your script will \"hang\" and the only way to get it\nto continue is to access rpdb using telnet, netcat, etc..:\n\n```shell\nnc 127.0.0.1 4444\n```\n\n## Installation in CPython (standard Python)\n\n```shell\npip install rpdb\n```\n\nFor a quick, ad hoc alternative, you can copy the entire rpdb subdirectory\n(the directory directly containing the __init__.py file) to somewhere on your\n`$PYTHONPATH`.\n\n## Installation in a Tomcat webapp\n\nJust copy the rpdb directory (the one with the __init__.py file) in your\nWEB-INF/lib/Lib folder along with the standard Jython library (required).\n\n## Trigger rpdb with signal\n\n`set_trace()` can be triggered at any time by using the TRAP signal handler.\nThis allows you to debug a running process independently of a specific failure\nor breakpoint:\n\n```python\nimport rpdb\nrpdb.handle_trap()\n\n# As with set_trace, you can optionally specify addr and port\nrpdb.handle_trap(\"0.0.0.0\", 54321)\n```\n\nCalling `handle_trap` will overwrite the existing handler for SIGTRAP if one has\nalready been defined in your application.\n\n## Known bugs\n\n- The socket is not always closed properly so you will need to ^C in netcat\n  and Esc+q in telnet to exit after a continue or quit.\n- There is a bug in Jython 2.5/pdb that causes rpdb to stop on ghost\n  breakpoints after you continue ('c'), this is fixed in 2.7b1.\n\n## Author(s)\n\nBertrand Janin <b@janin.com> - http://tamentis.com/\n\nWith contributions from (chronological, latest first):\n\n- Cameron Davidson-Pilon - @CamDavidsonPilon\n- Pavel Fux - @fuxpavel\n- Ken Manheimer - @kenmanheimer\n- Steven Willis - @onlynone\n- Jorge Niedbalski R <niedbalski@gmail.com>\n- Cyprien Le Pann\u00e9rer <clepannerer@edd.fr>\n- k4ml <kamal.mustafa@gmail.com>\n- Sean M. Collins <sean@coreitpro.com>\n- Sean Myers <sean.myers@redhat.com>\n\nThis is inspired by:\n\n- http://bugs.python.org/issue721464\n- http://snippets.dzone.com/posts/show/7248",
    "bugtrack_url": null,
    "license": null,
    "summary": "pdb wrapper with remote access via tcp socket",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "http://tamentis.com/projects/rpdb"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56dd39ee98f8fc0163f4df6264525fff2b87eef4b3d1a48db5936261e029ba15",
                "md5": "aeec73c3f53ee112ac8e9fcd98c15fd5",
                "sha256": "20e59ed87bbc0ec6a89ea883d8620f26c6e0877b851a49e19c239ad2c6bd4f49"
            },
            "downloads": -1,
            "filename": "rpdb-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aeec73c3f53ee112ac8e9fcd98c15fd5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5985,
            "upload_time": "2024-12-26T18:13:16",
            "upload_time_iso_8601": "2024-12-26T18:13:16.812452Z",
            "url": "https://files.pythonhosted.org/packages/56/dd/39ee98f8fc0163f4df6264525fff2b87eef4b3d1a48db5936261e029ba15/rpdb-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0f872dc67e3d5a005173b2e4165bdfdeb302ef38393b16312afe70f7a252f3ae",
                "md5": "4200ec41693da5990c15ab21b235bc42",
                "sha256": "8346f0dd498a1c30768af3d3528cdfe8086d8c057c9fccb5430b5aec32ae16ab"
            },
            "downloads": -1,
            "filename": "rpdb-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4200ec41693da5990c15ab21b235bc42",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5560,
            "upload_time": "2024-12-26T18:13:17",
            "upload_time_iso_8601": "2024-12-26T18:13:17.809818Z",
            "url": "https://files.pythonhosted.org/packages/0f/87/2dc67e3d5a005173b2e4165bdfdeb302ef38393b16312afe70f7a252f3ae/rpdb-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-26 18:13:17",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "rpdb"
}
        
Elapsed time: 0.48056s