469,281 Members | 2,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,281 developers. It's quick & easy.

Traceback Questions

ncf
I'm just beginning with tracebacks, building off of what I see in
asyncore's compact_traceback code, in order to hopefully store all the
values from the location in which the exception occured.

I'm actually trying to make this into a python bug report system for my
current project, and am seeking advice on how to use sys.exc_info()[2]
better (the traceback element)

Does anyone have any advice on how I'd preform a traceback-based
bugreport-like system? The more I work on this, the more I'm confusing
myself. :\

-Wes

This is the code from which I'm slowly figuring out the traceback
stuff:
import sys,pprint
a,b = 1,0
def mth(a,b):
moo = a/b
try:
mth(a,b)
except:
pass
tb = sys.exc_info()[2]
assert tb
def sprint(o):
pprint.pprint(dict([(x, getattr(o, x)) for x in dir(o) if
x[:2]!='__']), indent=2)
sprint(tb)
sprint(tb.tb_frame)
sprint(tb.tb_frame.f_code)

Aug 18 '05 #1
2 1010
ncf wrote:
I'm just beginning with tracebacks, building off of what I see in
asyncore's compact_traceback code, in order to hopefully store all the
values from the location in which the exception occured.

I'm actually trying to make this into a python bug report system for my
current project, and am seeking advice on how to use sys.exc_info()[2]
better (the traceback element)

Does anyone have any advice on how I'd preform a traceback-based
bugreport-like system? The more I work on this, the more I'm confusing
myself. :\


You may want to look at ipython's CrashHandler system:

http://projects.scipy.org/ipython/ip...rashHandler.py

It does all of what you've described in your post automatically. Some of it is
ipython-specific, but it should be easy enough to tweake it for your needs.

For download links (the above is an SVN source browsing link):

http://ipython.scipy.org

At some point I should really abstract this out, there seems to be a need for
it out there.

Cheers,

f

Aug 19 '05 #2
ncf
Thanks man, I'll definately take a look into this and hopefully port it
over and publish it.

Have a GREAT day

-Wes

Aug 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Oliver Walczak | last post: by
7 posts views Thread by Robin Becker | last post: by
1 post views Thread by Josh Close | last post: by
5 posts views Thread by Bob Greschke | last post: by
8 posts views Thread by gregpinero | last post: by
1 post views Thread by Sami Vaisanen | last post: by
1 post views Thread by Sami Vaisanen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.