[Patches] [ python-Patches-631276 ] Exceptions raised by line trace function

noreply@sourceforge.net noreply@sourceforge.net
Fri, 08 Nov 2002 05:13:02 -0800


Patches item #631276, was opened at 2002-10-30 22:06
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=631276&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Richie Hindle (richiehindle)
Assigned to: Michael Hudson (mwh)
Summary: Exceptions raised by line trace function

Initial Comment:
Exceptions raised by line trace functions are not handled.   I'm 
running the latest 2.3a0 (as of 30th October 2002).

When a trace function called with an event of 'line' raises an 
exception, that exception is ignored by maybe_call_line_trace.  
This means that program never sees the exception, and that the 
next genuine exception to be raised gets muddled up with the 
one raised by the trace function.  See the attached script for a 
demo.

The bug (as far as I can tell) is that maybe_call_line_trace is 
ignoring the return value of call_trace.  This patch makes 
maybe_call_line_trace pass that return value back to 
eval_frame, which then sets why to WHY_EXCEPTION and 
jumps to on_error.




----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2002-11-08 13:12

Message:
Logged In: YES 
user_id=6656

Is this Accepted or Fixed?  Does it matter?  Have I had
enough of sf's tracker yet...?

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-11-08 13:11

Message:
Logged In: YES 
user_id=6656

Checked in as:

Lib/test/test_trace.py revision 1.5
Python/ceval.c revision 2.341

after a little light massaging (I just checked in a
conflicting patch).

Cheers!

----------------------------------------------------------------------

Comment By: Richie Hindle (richiehindle)
Date: 2002-10-31 21:39

Message:
Logged In: YES 
user_id=85414

Here's the patch to test_trace.py.  RaisingTraceFuncTestCase now 
tests each of the four trace events independently.

Note that this doesn't show up the problem of the lost exception 
cropping up when another exception is raised - use the 
trace_exception_bug.py script if you want to see that.


----------------------------------------------------------------------

Comment By: Richie Hindle (richiehindle)
Date: 2002-10-31 14:38

Message:
Logged In: YES 
user_id=85414

Will do, later today.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-10-31 10:38

Message:
Logged In: YES 
user_id=6656

Blame for this one is easy to find...

Patch looks OK.  Could I ask you to munge the test into a
patch to test_trace?  Otherwise I'll do it, but maybe not today.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=631276&group_id=5470