This is definitely a bug (and quite an annoying one at that).  I've opened 
CodePlex bug #21199 to track the issue 
(http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=21199).  
Thanks for the report!

I'll try and get this fixed in 2.6 fairly soon and depending on what the fix 
looks like it might get back ported to 2.0.2.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Howland-Rose, Kyle
Sent: Thursday, February 12, 2009 3:23 PM
To: [email protected]
Subject: [IronPython] try breaks traceback

Hi all,

ipy 2.0 traceback seems to lose track of where exceptions come from inside 
try-except blocks (which hampers debugging):

bash-3.2$ cat foo.py
import bar
class E(Exception):
  def __init__(self, message):
    Exception.__init__(self, message)
try:
 bar.baz()
except E, ex:
 pass

bash-3.2$ cat bar.py
def baz():
 "".sort(key=key_comparer.key)

bash-3.2$ ipy foo.py
Traceback (most recent call last):
  File "foo.py", line 6, in foo.py
AttributeError: 'str' object has no attribute 'sort'bash-3.2$

if I take the try-except block out I get the correct module line number:

bash-3.2$ cat foo2.py
import bar
class E(Exception):
  def __init__(self, message):
    Exception.__init__(self, message)
bar.baz()

bash-3.2$ ipy foo2.py
Traceback (most recent call last):
  File "foo2.py", line 5, in foo2.py
  File "h:\jobs\chris21views\bar.py", line 2, in baz
AttributeError: 'str' object has no attribute 'sort'bash-3.2$

Before I raise a bug I thought I would just check that I am not missing 
something here.

Thanks, Kyle



************************************************************************

Allens Arthur Robinson online: http://www.aar.com.au

This email is confidential and may be subject to legal or other professional 
privilege. It is also subject to copyright. If you have received it in error, 
confidentiality and privilege are not waived and you must not disclose or use 
the information in it. Please notify the sender by return email and delete it 
from your system. Any personal information in this email must be handled in 
accordance with the Privacy Act 1988 (Cth).

*************************************************************************
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to