[IronPython] Change in stack traces

Glenn Jones glenn.k.jones+ipy at gmail.com
Wed Dec 17 18:37:41 CET 2008


Hi all,

Another observation from the Resolver One upgrade:
When we run the following:
        engine = Python.CreateEngine()
        scope = engine.CreateScope()
        script = """
def Fn():
    raise Exception
Fn()
"""
        source = engine.CreateScriptSourceFromString(script, 'aname',
SourceCodeKind.Statements)
        code = source.Compile()
        code.Execute(scope)

We get a stacktrace that looks like this:
  File "stacktrace.py", line 10, in testStackTrace
    code.Execute(scope)
  File "aname", line 4, in aname
  File "aname", line 3, in Fn

The equivalent code in IPy1 and Python 2.5, has
  File "aname", line 4, in <module>
instead of
  File "aname", line 4, in aname


When we don't pass the name into the call to CreateScriptSourceFromString,
we get:
  File "stacktrace.py", line 10, in testStackTrace
    code.Execute(scope)
  File "<string>", line 4, in <module>
  File "<string>", line 3, in Fn

Is there a way for us to get behaviour like IPy1 and Python 2.5? Is this
possibly a bug in the traceback generation of IPy2?

Thanks
Glenn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081217/92de877f/attachment.html>


More information about the Ironpython-users mailing list