[IPython-user] ipython prevents sys.last_traceback (etc.) from being set?

Zachary Pincus zpincus at stanford.edu
Thu Mar 9 17:30:48 CST 2006


Hi folks,

I'm trying ipython with a fresh build of python 2.5. Everything seems  
to work, except that exceptions no longer cause sys.last_traceback  
(and last_value and last_type) to be set. (This works fine in the  
normal python shell.)

This means that pdb.pm(), which uses sys.last_traceback, doesn't work  
anymore. The magic %pdb works fine, but I usually prefer to manually  
fire off pdb.pm() when I need it, instead of having it open at every  
exception. (Aside: is there any way to easily run iPython's enhanced  
postmortem, but only on-demand, and not automatically like setting % 
pdb does?)

It seems that somehow, ipython is preventing sys.last_[traceback|type| 
value] from being set when an exception happens. The changelog  
mentions that these values are no longer used in ipython, but I  
assume that ipython isn't actively preventing them from being set at  
all?
> 	* IPython/iplib.py (showtraceback): remove use of the
> 	sys.last_{type/value/traceback} structures, which are non
> 	thread-safe.

Let me know what I can do to help track this down.
Thanks,

Zach Pincus

Program in Biomedical Informatics and Department of Biochemistry
Stanford University School of Medicine




More information about the IPython-user mailing list