[Python.NET] managed exception stack trace.

Brian Lloyd brian at zope.com
Thu Jan 20 19:48:01 CET 2005


> I am using pythonNet with a great pleasure, thanks a lot for that piece 
> of work.
> 
> IMHO, a wiki would be very very useful for this project, as I would be 
> ready to contribute...
> 
> One question:
> 
> How do I print out managed exceptions full stack trace?

Hi Stan - 

A trick you might be able to use is:

print CLR.System.Environment.StackTrace

Exceptions are in kind of an odd state right now - the C Python runtime 
really wants exceptions to be old-style Python classes, and the fact 
that managed exceptions aren't causes some problems in the current 
version of Python for .NET. I'm still hoping to find a sneaky way 
around it or successfully lobby the Python devs to remove this 
restriction for a future Python version.

Brian Lloyd        brian at zope.com
V.P. Engineering   540.361.1716              
Zope Corporation   http://www.zope.com 




More information about the PythonDotNet mailing list