Skip to main content

Remotely debug your Python application via IRC.

Project description

ircpdb - Remotely debug your Python application from an IRC channel

Ircpdb is an adaptation of rpdb that, instead of opening a port and allowing you to debug over telnet, connects to a configurable IRC channel so you can collaboratively debug an application remotely.

import ircpdb
ircpdb.set_trace(
    channel="#debugger_hangout",
)

By default, ircpdb will create the channel you specify on Freenode and randomly select a nickname for itself, but you can feel free to configure ircpdb to connect anywhere:

import ircpdb
ircpdb.set_trace(
    channel="#debugger_hangout",
    nickname='im_a_debugger',
    server='irc.mycompany.org',
    limit_access_to=['mynickname'],
    port=6667,
    ssl=True,
)

Upon reaching set_trace(), your script will “hang” and the only way to get it to continue is to access ircpdb by talking to the user that connected to the above IRC channel.

By default, the debugger will enter the channel you’ve specified using a username starting with the hostname of the computer from which it was launched (in the following example: ‘MyHostname’). To interact with the debugger, just send messages in the channel prefixed with “MyHostname:”, or simply “!”.

For example, the following two commands are equivalent, and each will display the pdb help screen (be sure to replace ‘MyHostname’ with whatever username the bot selected):

!help

MyHostname: help

Installation in CPython (standard Python)

pip install ircpdb

Troubleshooting

If you do not see the bot entering your specified channel, try increasing the logging level by adding the following lines above your trace to gather a little more information about problems that may have occurred while connecting to the IRC server:

import logging
logging.basicConfig(level=logging.DEBUG)

Author(s)

Adam Coddington <me@adamcoddington.net> - http://adamcoddington.net/

This library is a fork of rpdb, and the underpinnings of this library are owed to Bertrand Janin <b@janin.com> - http://tamentis.com/ and all other contributors to rpdb <https://github.com/tamentis/rpdb> including the following:

0.1.6 (YYYY-MM-DD)

0.1.5 (2014-10-16)

  • Write addr/port to stderr instead of stdout (thanks to @onlynone).

  • Allow for dynamic host port (thanks to @onlynone).

  • Make q/quit do proper cleanup (@kenmanheimer)

  • Benignly disregard repeated rpdb.set_trace() to same port as currently active session (@kenmanheimer)

  • Extend backwards compatibility down to Python 2.5 (@kenmanheimer)

0.1.4 (2014-04-28)

  • Expose the addr, port arguments to the set_trace method (thanks to @niedbalski).

0.1.3 (2013-08-02)

  • Remove a try/finally that seemed to shift the trace location (thanks to k4ml@github).

0.1.2 (2012-01-26)

  • Catch IOError raised by print in initialization, it may not work in some environments (e.g. mod_wsgi). (Menno Smits)

0.1.1 (2010-05-09)

Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ircpdb-1.0.15.tar.gz (7.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page