traceback module

Posted on 2011-10-09
Last Modified: 2012-05-12
I want to capture as much information about an exception as I can ... using the traceback module I want all the details of an exception including any errors from the OS interaction... Below is the code I'm using but I don't want the info to print to the screen but to my log file and what arguments give me the most detail especially the glitch Im searching for that only occurs occasionally and I suspect is a conflict between wxpython and windows os...


except Exception, err:
	    #print 'format_exception():'
	    exc_type, exc_value, exc_tb = sys.exc_info()
	    pprint(traceback.format_exception(exc_type, exc_value, exc_tb))    

Open in new window

Question by:dolamitejenkins
    LVL 16

    Accepted Solution

    You might try following Softawre:

    Nothing to do with Python or WxWidgets, but it should help to trace system calls (similiar to strace on Linux) on a Windows machine.

    The Software is already rather old, but I don't know any newer Software, which is doing the same job.

    I wonder whether your safest bet wouldn't be to try to find the smallest possible program reproducing the bug and trying to contact the wxWidgets community.

    I once had a Problem with Python QT and after quite some work) I was able to reduce it to a 30 line Python application, which I could rewrite as C++ application reproducing the same behaviour (thus excluding python from the list of culprits) and having a test case, which could be sent to the Qt community (which isn't necessarily 'fluent' in Python)


    Author Comment

    i've been trying to do that but I don't know what triggers the error and it seems to be so random when it happens that its hard to narrow down my code... i'm working on it... thanks for the guidance I truly appreciate it

    Author Closing Comment

    took your advice and went to the wxpython community and i think they solved the problem

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This article will show, step by step, how to integrate R code into a R Sweave document
    The purpose of this article is to demonstrate how we can use conditional statements using Python.
    The viewer will learn how to count occurrences of each item in an array.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now