Issue1249

classification
Title: Trace function is not called with an exception event exactly when the exception occurs
Type: behaviour Severity: normal
Components: Core Versions: 2.5b1
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pjenvey Nosy List: jha, pjenvey
Priority: Keywords:

Created on 2009-01-27.08:11:18 by jha, last changed 2009-03-26.16:49:39 by pjenvey.

Files
File name Uploaded Description Edit Remove
trace_exc.py jha, 2009-01-27.08:11:15
Messages
msg4084 (view) Author: (jha) Date: 2009-01-27.08:11:15
Running the attached script with Jython (r5984) produces:

~> java -jar jython.jar /tmp/trace_exc.py
<trace> call in bar @ 13
<trace> line in bar @ 14
<trace> call in foo @ 7
<trace> line in foo @ 9
<trace> line in foo @ 11
<trace> exception in foo @ 11
<trace> exception in bar @ 14

..and running with CPython (2.5.1, 2.5.2, 2.6) produces:

 ~> python /tmp/trace_exc.py
<trace> call in bar @ 13
<trace> line in bar @ 14
<trace> call in foo @ 7
<trace> line in foo @ 8
<trace> line in foo @ 9
<trace> exception in foo @ 9
<trace> line in foo @ 11
<trace> return in foo @ 11
<trace> exception in bar @ 14
<trace> return in bar @ 14

Jython calls the trace function with an exception event at the end of
the finally block when the exception is reraised and the frame is
exited. CPython reports the event when the exception occurs.
msg4089 (view) Author: (jha) Date: 2009-01-27.12:59:27
Before r5815 the behavior was this (still differs from CPython):

<trace> call in bar @ 13
<trace> line in bar @ 14
<trace> call in foo @ 7
<trace> line in foo @ 9
<trace> exception in foo @ 9
<trace> line in foo @ 11
<trace> exception in foo @ 11
<trace> exception in bar @ 14

So the exception event is reported when it occurs and every time it is
reraised/frame is exited.
msg4091 (view) Author: Philip Jenvey (pjenvey) Date: 2009-01-27.20:11:03
I broke this, over to me
msg4356 (view) Author: Philip Jenvey (pjenvey) Date: 2009-03-26.16:49:38
restored to the previous behavior as of r6108, thanks
History
Date User Action Args
2009-03-26 16:49:39pjenveysetstatus: open -> closed
resolution: fixed
messages: + msg4356
2009-01-27 20:11:04pjenveysetassignee: pjenvey
messages: + msg4091
nosy: + pjenvey
2009-01-27 12:59:27jhasetmessages: + msg4089
2009-01-27 08:11:19jhacreate