I've just started trying to use Gestalt/dlr.js. I have a simple test
script (js.py), which throws an exception, then tries to extract a
line number from the exception.

---------
import sys

def b():
    try:
        raise Exception()
    except Exception as ex:
        exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
        return exceptionTraceback.tb_frame.f_lineno

def a():
    return b()

a()
---------

When run in my browser, this fails, and displays this error:

---------
IOError: [Errno 2] Error 0x1A88.  Debugging resource strings are
unavailable. See
http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.50106.0&File=mscorrc.dll&Key=0x1A88

js.py
Line 6:     except Exception as ex:
Line 7:         exceptionType, exceptionValue, exceptionTraceback =
sys.exc_info()
Line 8:         return exceptionTraceback.tb_frame.f_lineno
Line 9:
Line 10: def a():

IOError
at b in js.py, line 8
at a in js.py, line 11
at <module> in js.py, line 13
---------

This appears to be a message telling me that line numbers are
unavailable which, paradoxically, includes all of the line numbers.
Looking through the DLR source, I see it is getting the line number
from a DynamicStackFrame
(http://dlr.codeplex.com/sourcecontrol/network/Show?projectName=dlr&changeSetId=45843#580636),
but I don't see how to get this information from Python.

I've tried setting DLR.settings.debug to true, without any effect.
What is the correct way to enable resource strings so that they are
are accessible from Python, or what else could I do to access them?

Thanks,

Ryan
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to