[IronPython] help with an IPy traceback

Dino Viehland dinov at microsoft.com
Thu Aug 13 05:43:42 CEST 2009


It looks like this code is hosted somewhere.  So who is catching the
exception in this case?  If it's you then you can do:

pythonEngine.GetService<ExceptionOperations>().FormatException(exception);

to get a standard Python version of the stack trace.

W/o doing that the .NET stack trace is basically useless.  Sometimes code
is interpreted which gives you no info and even when it's compiled
it's usually as DynamicMethod's which don't have debugging info associated
with them.  If you enable debug mode though (-X:Debug from the command line
or setting DebugMode on a ScriptRuntimeSetup) then you'll at least get some
.py file line numbers in all the noise.  But there's also lots of other
frames which show up from the DLR and IronPython infrastructure which
makes it confusing.

If the code isn't hosted and you're getting this exception from pure
Python code then it'd be a bug.  One thing to watch out for is if you've
done from System import * then "except Exception, e:" will give you
the .NET exception object.

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Count László de Almásy
> Sent: Wednesday, August 12, 2009 8:20 PM
> To: Discussion of IronPython
> Subject: [IronPython] help with an IPy traceback
>
> i'm still getting used to the tracebacks that IPy / .NET produces. I'm
> used to CPython always telling me which line of code to look for the
> problem at. Is there a way to find where in my .py program the source
> of this problem lies? It looks like gobbledegook to me:
>
> 2009-08-12 20:11:51,782 [XML-RPC Login] ERROR -
> System.MissingMemberException: Parcel instance has no attribute
> 'client'
> at (wrapper dynamic-method) object._stub_$231##142
> (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions
> .CallSite,object,Microsoft.Scripting.Runtime.CodeContex
> t) <0x0017b>
> at Microsoft.Scripting.Actions.MatchCaller.Call2<object,
> Microsoft.Scripting.Runtime.CodeContext, object>
> (Microsoft.Func`4<Microsoft.Scripting.Actions.CallSite, object,
> Microso
> ft.Scripting.Runtime.CodeContext,
> object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x00093>
> at (wrapper static-rgctx-invoke)
> Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func
> `4<CallSite,
> object, CodeContext, object>_CallSite_object[] (Microsoft.Fu
> nc`4<Microsoft.Scripting.Actions.CallSite, object,
> Microsoft.Scripting.Runtime.CodeContext,
> object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b>
> at
> Microsoft.Scripting.Actions.CallSite`1<Microsoft.Func`4<Microsoft.Scrip
> ting.Actions.CallSite,
> object, Microsoft.Scripting.Runtime.CodeContext,
> object>>.UpdateAndExecute (obje
> ct[]) <0x005ea>
> at
> Microsoft.Scripting.Actions.UpdateDelegates.Update2<Microsoft.Func`4<Mi
> crosoft.Scripting.Actions.CallSite,
> object, Microsoft.Scripting.Runtime.CodeContext, object>, object, M
> icrosoft.Scripting.Runtime.CodeContext, object>
> (Microsoft.Scripting.Actions.CallSite,object,Microsoft.Scripting.Runtim
> e.CodeContext)
> <0x0008b>
> at (wrapper static-rgctx-invoke)
> Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_
> CallSite_object_CodeContext
> (Microsoft.Scripting.Actions.CallSite,object,
> Microsoft.Scripting.Runtime.CodeContext) <0x0002b>
> at S$3._Network_OnConnected$23
> (Microsoft.Runtime.CompilerServices.Closure,object,object) <0x0010b>
> at (wrapper dynamic-method) object._stub_$230##141
> (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions
> .CallSite,Microsoft.Scripting.Runtime.CodeContext,objec
> t,object,object) <0x0018e>
> at (wrapper dynamic-method) object._stub_$229##140
> (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions
> .CallSite,object,object)
> <0x00170>
> at Microsoft.Scripting.Actions.MatchCaller.Call2<object, object,
> object> (Microsoft.Func`4<Microsoft.Scripting.Actions.CallSite,
> object, object, object>,Microsoft.Scripting.Acti
> ons.CallSite,object[]) <0x00093>
> at (wrapper static-rgctx-invoke)
> Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func
> `4<CallSite,
> object, object, object>_CallSite_object[] (Microsoft.Func`4<
> Microsoft.Scripting.Actions.CallSite, object, object,
> object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b>
> at
> Microsoft.Scripting.Actions.CallSite`1<Microsoft.Func`4<Microsoft.Scrip
> ting.Actions.CallSite,
> object, object, object>>.UpdateAndExecute (object[]) <0x00444>
> at
> Microsoft.Scripting.Actions.UpdateDelegates.Update2<Microsoft.Func`4<Mi
> crosoft.Scripting.Actions.CallSite,
> object, object, object>, object, object, object> (Microsoft.Scripti
> ng.Actions.CallSite,object,object) <0x0008b>
> at (wrapper static-rgctx-invoke)
> Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_
> CallSite_object_object
> (Microsoft.Scripting.Actions.CallSite,object,objec
> t) <0x0002b>
> at (wrapper dynamic-method) object.System.Void(Object)
> (object[],object) <0x00062>
> at (wrapper delegate-invoke)
> OpenMetaverse.NetworkManager/ConnectedCallback.invoke_void__this___obje
> ct
> (object) <0x0004f>
> at OpenMetaverse.NetworkManager.LoginReplyXmlRpcHandler
> (Nwc.XmlRpc.XmlRpcResponse,OpenMetaverse.LoginParams) <0x00954>
>
> --
> Cheers, László
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list