Issue625391

classification
Title: traceback.print_exc
Type: Severity: normal
Components: Library Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pedronis
Priority: normal Keywords:

Created on 2002-10-18.20:07:56 by pedronis, last changed 2004-01-27.19:34:31 by pedronis.

Messages
msg767 (view) Author: Samuele Pedroni (pedronis) Date: 2002-10-18.20:07:56
https://sourceforge.net/mailarchive/message.php?
msg_id=2241629


import sys
 import traceback
 
 def divide(x,y):
     return x/y
 
 try:
     print divide(8,0)
 except:
     traceback.print_exc()
     sys.exit(1)
 sys.exit(0)
 
 When I execute this program in Python I get the 
following output:
 
 Traceback (most recent call last):
   File "excepttest.py", line 8, in ?
     print divide(8,0)
   File "excepttest.py", line 5, in divide
     return x/y
 ZeroDivisionError: integer division or modulo by zero
 
 The output contains a complete stack trace that I can 
use for debugging
 purposes.  However, when I execute this program in 
Jython I get the
 following:
 
 Traceback (most recent call last):
   File "excepttest.py", line 5, in divide
     return x/y
 ZeroDivisionError: integer division or modulo
 
msg768 (view) Author: Samuele Pedroni (pedronis) Date: 2004-01-27.19:24:27
Logged In: YES 
user_id=61408

jython wasn't attaching to the traceback the catching frame,
i.e. the one doing the except.

added test382

there is no simple workaround; inside the expect the lineno info
about the offending line in the frame doing the except is
already lost.
msg769 (view) Author: Samuele Pedroni (pedronis) Date: 2004-01-27.19:34:31
Logged In: YES 
user_id=61408

fixed in Py.java 2.71. test382 passes.
History
Date User Action Args
2002-10-18 20:07:56pedroniscreate