This is related to http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=2912. We are currently working on it.
Thanks for reporting this. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: Friday, January 05, 2007 4:58 PM To: Discussion of IronPython Subject: [IronPython] Traceback Stack Bugs Hello team, Whilst optimising Resolver we discovered a bug in the handling of traceback objects with IronPython. The following code behaves differently under IronPython and CPython : import sys def extract_tb(): tb = sys.exc_info()[2] stackInfo = [] while tb: f = tb.tb_frame lineno = tb.tb_lineno co = f.f_code filename = co.co_filename stackInfo.append((filename, lineno)) tb = tb.tb_next return stackInfo try: raise ValueError('stuff') except: print extract_tb() try: raise ValueError('stuff') except: print extract_tb() Under IronPython : [] [] Under CPython : [('C:\\Python Projects\\modules in progress\\ironpython\\tracebackBug.py', 15)] [('C:\\Python Projects\\modules in progress\\ironpython\\tracebackBug.py', 20)] If you exec a compiled code object which raises an exception (instead of directly raising the error) the CPython traceback starts with the Python code, whereas the IronPython traceback starts with the code object and goes no further back. (So a different bug...) The bug I was actually trying to expose is that in Resolver we were finding that the traceback objects were not being cleared out - the stack (using the extract_tb function above) was getting longer and longer. Adding an explicit sys.clear_exc() solved our problem, but it foxed us for a while. Unfortunately I can't reproduce this bug easily - but you can see that something screwy is going on. Michael http://www.voidspace.org.uk/ironpython/index.shtml _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
