[PEAK] DecoratorTools and pydev (eclipse) debugging

Phillip J. Eby pje at telecommunity.com
Fri Jun 27 18:17:01 EDT 2008

At 08:01 PM 6/27/2008 +0200, Ulrich Eck wrote:
>Hi Phillip,
>is there any chance to get DecoratorTools working with py2.5 / pydev 
>to debug my applications.
>there is a problem with the debugger-hook described here:
>there is also a (only for debugging) workaround which doesn't work 
>in my setup as discussed.
>sys.settrace() should not be used when the debugger is being used.
>This may cause the debugger to stop working correctly.
>If this is needed, please check:
>to see how to restore the debug tracing back correctly.
>Call Location:
>   File 
> "/Library/Python/2.5/site-packages/DecoratorTools-1.7-py2.5.egg/peak/util/decorators.py", 
> line 610, in decorate_assignment
>     sys.settrace(tracer)

My recommendation is to patch the code that is generating the above 
warning, to first see if the caller is restoring PyDev's tracer, and 
if so, to call the old sys.settrace() on PyDev's global trace 
function (rather than the frame-specific one).

I've just posted a comment to the blog article above, saying 
basically the same thing.

(This problem would also be solvable if Python offered a 
"sys.gettrace()" function, but sadly no such thing is available ATM.)

More information about the PEAK mailing list