[IronPython] The bug about Tuple

Michael Tan fantasysoft at hotmail.com
Thu Jan 5 16:23:27 CET 2006

Dear All,
    I find these codes that run OK in IP 0.96 throw exception in IP 1.0. 
Here are the codes:
    >>> def A(*args):
    ...     print args
    >>> def B(*args):
    ...     A(*args)
System.NullReferenceException: Object reference not set to an instance of 
an object.
   at IronPython.Runtime.Frame.TryGetLocal(String name, Object& ret) in 
IronPython\Runtime\Frame.cs:line 67
   at IronPython.Runtime.Frame.GetGlobal(String name) in 
ime\Frame.cs:line 90
   at moduleHolder_1.B$f1(Object args)
   at moduleHolder_1.B$f1(Object[] )
   at IronPython.Runtime.FunctionX.Call(Object[] args) in 
time\Function.cs:line 968
   at IronPython.Runtime.FunctionN.Call(Object arg0, Object arg1, Object 
arg2) in F:\IronPython-1.0-
Beta1\Src\IronPython\Runtime\Function.cs:line 849
   at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object 
func, Object arg0, Objec
t arg1, Object arg2) in 
F:\IronPython-1.0-Beta1\Src\IronPython\Runtime\Ops.cs:line 2055
   at input##0(Frame )
   at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame)
   at IronPython.Runtime.FrameCode.Run(Frame frame) in 
e\Frame.cs:line 165
   at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) in 
c\IronPython\Hosting\PythonEngine.cs:line 333
   at IronPython.Hosting.PythonEngine.RunInteractive() in 
ting\PythonEngine.cs:line 272
Exception: Object reference not set to an instance of an object.

      When I debug this error, I also find the f_locals in Frame.cs is the 
key point. When the global function with name B is retrieved, the f_locals 
is fine. And the workflow continues, the global function with name A should 
be fetched, but this time f_locals is null!  I don't know what reset the 
f_locals variable, but I guess the Tuple.cs may be the criminal.


More information about the Ironpython-users mailing list