Get stack trace from C

Eric Frederich eric.frederich at gmail.com
Wed Apr 18 16:01:22 EDT 2012


There are several things I'd like to do with the exceptions.
Printing the 3rd party applications log via their own printf-like function.
Also, calling one of their functions that stores an error string on a stack.
In either case, I need access to the error string as a char*.

On Tue, Apr 17, 2012 at 1:15 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:

> Eric Frederich, 16.04.2012 20:14:
> > I embed Python in a 3rd party application.
> > I need to use their conventions for errors.
> >
> > Looking here...
> >     http://docs.python.org/extending/embedding.html#pure-embedding
> > ....the example uses PyErr_Print() but that goes to stdout or stderr or
> > something.
> >
> > I need to put the error somewhere else.  How can I get at the traceback
> > text?
>
> You can use the traceback module to format it, just as you would in Python.
>
> If you need further help, you may want to provide more information, e.g.
> what "their conventions" are and what kind of application we are talking
> about (graphic, headless server, ...).
>
> Stefan
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120418/b68fde7f/attachment-0001.html>


More information about the Python-list mailing list