[IPython-dev] svnversion used for Release.py

R. Bernstein rocky at panix.com
Wed Nov 29 02:57:28 CST 2006


Fernando Perez writes:
 > No, the problem is a bit more subtle than that: it's not the 'import
 > readline' that causes problems, but rather the fact that the
 > constructor fires this call:
 > 
 > 2.4:
 > class Pdb(bdb.Bdb, cmd.Cmd):
 > 
 >     def __init__(self):
 >         bdb.Bdb.__init__(self)
 >         cmd.Cmd.__init__(self)
 > 
 > 2.5:
 > class Pdb(bdb.Bdb, cmd.Cmd):
 > 
 >     def __init__(self, completekey='tab', stdin=None, stdout=None):
 >         bdb.Bdb.__init__(self)
 >         cmd.Cmd.__init__(self, completekey, stdin, stdout)
 > 
 > The critical difference is that the 2.5 constructor exposes the
 > 'completekey' parameter publicly, and correctly passes it down to the
 > cmd.Cmd constructor, so we can nicely override it to None and avoid
 > any readline-related misconfiguration issues.  Prior to 2.5, this
 > parameter was not accessible from the Pdb constructor and the default
 > value of 'tab' would always fire.
 > 
 > 
 > Does that help?

This helps a bit, thanks. A suitably recent version of the pydb
follows the Python 2.5 constructor convention - it doesn't matter what
the Python version is. If pydb is used, (and we do check for a
suitably recent version), then that hack is *not* needed. So

class Pdb(OldPdb):
    """Modified Pdb class, does not load readline."""

    if sys.version[:3] >= '2.5'

can become

    if sys.version[:3] >= '2.5' or has_pydb:

I've attached a patch for this below.

I'm still not clear about one other thing though, and this is not
addressed in the patch but perhaps should be.

When you create the debugger you turn off any readline completion,
right? But is this correct whne pydb is used? pydb sets up command
completion correctly for itself, and I'd venture to say that this
would be more helpful in the debugger context than the default ipython
command completion.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pydb-debug.diff
Type: application/octet-stream
Size: 922 bytes
Desc: Don't need Python 2.3, 2.4 hack if pydb is used.
Url : http://projects.scipy.org/pipermail/ipython-dev/attachments/20061129/f42ac22d/attachment.obj 


More information about the IPython-dev mailing list