1 message in org.python.python-bugs-list[ python-Bugs-751124 ] Enhancements t...
FromSent OnAttachments
SourceForge.netMar 12, 2004 12:24 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Bugs-751124 ] Enhancements to pdb.py when invoked as scriptActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 12, 2004 12:24:30 pm
List:org.python.python-bugs-list

Bugs item #751124, was opened at 2003-06-08 19:19 Message generated for change (Comment added) made by isandler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751124&group_id=5470

Category: Python Library Group: Feature Request Status: Open Resolution: None Priority: 5 Submitted By: Christian Stork (cst) Assigned to: Nobody/Anonymous (nobody) Summary: Enhancements to pdb.py when invoked as script

Initial Comment: Three little enhancements/mini-bugs:

1) Adding the following lines to the "main part" of pdb.py gives it the ability to stay in pdb if the program crashes. Very handy!

# Ensure that we end up in pdb if we crash def pdb_on_crash(type, value, tb): sys.__excepthook__(type, value, tb) post_mortem(tb) sys.excepthook = pdb_on_crash

2) There's also a problem in the last lines of pdb.py:

# Insert script directory in front of module search path sys.path.insert(0, os.path.dirname(filename))

This leaves the directory path under which pdb.py was invoked in sys.path. This is a problem if pdb.py was invoked e.g. via a link a la /usr/pdb. This leads to the last and related suggestion.

3) It would be very convenient if a pyhon installation would also install a link /usr/pdb -> /usr/lib/python2.3/pdb.py. This provides for easy invocation and, for example, it's also the default command used by Emacs' pdb-mode.

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

Comment By: Ilya Sandler (isandler) Date: 2004-03-12 09:24

Message: Logged In: YES user_id=971153

a note for the reviewer:

patch #896011 fixes bug (2) and implements (in a different manner but with the same result) feature (1),

PS. I would also like to add my vote for (3). Being a command line tool pdb.py deserves to be installed right next to python binary..(on Linux that would often be /usr/bin)

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