[Python-bugs-list] [ python-Bugs-676342 ] after using pdb readline does not work correctly

SourceForge.net noreply@sourceforge.net
Tue, 28 Jan 2003 12:53:56 -0800


Bugs item #676342, was opened at 2003-01-28 20:53
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=676342&group_id=5470

Category: Python Library
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Stone (mbrierst)
Assigned to: Nobody/Anonymous (nobody)
Summary: after using pdb readline does not work correctly

Initial Comment:

After I use pdb in the interpreter my readline settings are messed up.  It only knows about the pdb readline stuff forever afterward.  In fact, this happens as soon as a Pdb object is instantiated, regardless of whether or not you use it.

This is a result of some aspects of the Cmd object in Lib/cmd.py.

Currently Cmd registers a new readline completer as soon as a Cmd object is instantiated.  This is probably incorrect.  I believe the correct place to register the new handler is in the preloop hook.  That way the new readline completer is only used while the Cmd object is actually responsible for processing user input.

Next, the old readline completer should probably be re-registered in the postloop hook.  In order to do this, a new call must be added to the readline module to return the current completer so it can be saved and later restored.

The files included patch readline.c (version 2.41.64) and cmd.py (version 1.26.16.2) to make the changes described above.  After this patch readline works as expected in the interpreter.

Let me know what you think of it.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=676342&group_id=5470