[IronPython] IP2A4 - Bug when Exception thrown on worker thread

Davy Mitchell daftspaniel at gmail.com
Tue Oct 9 20:57:02 CEST 2007


Hi - the following snippit crashes IP2A4.

import clr
from System.Threading import ApartmentState,Thread, ThreadStart

def Run():
    print wibble

t = Thread(ThreadStart(Run))
t.ApartmentState = ApartmentState.STA
t.Start()
Thread.Sleep(90000)

Unhandled Exception: Microsoft.Scripting.UnboundNameException: name 'wibble' is
not defined
   at IronPython.Runtime.PythonContext.MissingName(SymbolId name)
   at Microsoft.Scripting.ModuleGlobalWrapper.GetCachedValue()
   at Microsoft.Scripting.ModuleGlobalWrapper.get_CurrentValue()
   at __main__$mod_2.Run$1() in bug.py:line 5
   at _stub_##17(Object[] , DynamicSite`2 , CodeContext , Object )
   at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeConte
xt context, T0 arg0)
   at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7
.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0)
   at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 a
rg0)
   at System.Void(), using PythonBinder##9(Object[] )
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

-- 
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel
needgod.com



More information about the Ironpython-users mailing list