Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Python.Runtime.MethodBinder.MatchParameters(MethodInfo[] mi, Type[] tp)
at Python.Runtime.MethodBinder.Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo)
at Python.Runtime.MethodBinder.Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo)
at Python.Runtime.MethodObject.Invoke(IntPtr target, IntPtr args, IntPtr kw, MethodBase info)
at Python.Runtime.MethodBinding.tp_call(IntPtr ob, IntPtr args, IntPtr kw)
at Python.Runtime.Runtime.Py_Main(Int32 argc, String[] argv)
at Python.Runtime.PythonConsole.Main(String[] args)
Activity
den-run-ai commented on Jan 22, 2016
values = [1, 2, 3] is PyList and hence only implements IEnumerable basic interface (not generic):
https://msdn.microsoft.com/en-us/library/system.collections.ienumerable(v=vs.110).aspx
tonyroberts commented on Jan 22, 2016
@denfromufa it shouldn't crash the runtime though, it should raise a Python exception if there's a problem.
galpin commented on Jan 22, 2016
@tonyroberts Quite.
den-run-ai commented on Jan 31, 2016
full traceback from debug build (after tp_call):
> Python.Runtime.dll!Python.Runtime.MethodBinder.MatchParameters(System.Reflection.MethodInfo[] mi, System.Type[] tp) Line 77 C# Python.Runtime.dll!Python.Runtime.MethodBinder.Bind(System.IntPtr inst, System.IntPtr args, System.IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) Line 345 C# Python.Runtime.dll!Python.Runtime.MethodBinder.Invoke(System.IntPtr inst, System.IntPtr args, System.IntPtr kw, System.Reflection.MethodBase info, System.Reflection.MethodInfo[] methodinfo) Line 363 C# Python.Runtime.dll!Python.Runtime.MethodObject.Invoke(System.IntPtr target, System.IntPtr args, System.IntPtr kw, System.Reflection.MethodBase info) Line 65 C# Python.Runtime.dll!Python.Runtime.MethodBinding.tp_call(System.IntPtr ob, System.IntPtr args, System.IntPtr kw) Line 179 C#autos:
count 0 int - mi {System.Reflection.MethodInfo[2]} System.Reflection.MethodInfo[] - [0] {TSource First[TSource](System.Collections.Generic.IEnumerable`1[TSource])} System.Reflection.MethodInfo {System.Reflection.RuntimeMethodInfo} Attributes Public | Static | HideBySig System.Reflection.MethodAttributes CallingConvention Standard System.Reflection.CallingConventions ContainsGenericParameters true bool + CustomAttributes Count = 2 System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> {System.Collections.ObjectModel.ReadOnlyCollection<System.Reflection.CustomAttributeData>} + DeclaringType {Name = "Enumerable" FullName = "System.Linq.Enumerable"} System.Type {System.RuntimeType} IsAbstract false bool IsAssembly false bool IsConstructor false bool IsFamily false bool IsFamilyAndAssembly false bool IsFamilyOrAssembly false bool IsFinal false bool IsGenericMethod true bool IsGenericMethodDefinition true bool IsHideBySig true bool IsPrivate false bool IsPublic true bool IsSecurityCritical false bool IsSecuritySafeCritical false bool IsSecurityTransparent true bool IsSpecialName false bool IsStatic true bool IsVirtual false bool MemberType Method System.Reflection.MemberTypes MetadataToken 100665141 int + MethodHandle {System.RuntimeMethodHandle} System.RuntimeMethodHandle MethodImplementationFlags IL System.Reflection.MethodImplAttributes + Module {System.Core.dll} System.Reflection.Module {System.Reflection.RuntimeModule} Name "First" string + ReflectedType {Name = "Enumerable" FullName = "System.Linq.Enumerable"} System.Type {System.RuntimeType} + ReturnParameter {TSource } System.Reflection.ParameterInfo {System.Reflection.RuntimeParameterInfo} + ReturnType {Name = "TSource" FullName = null} System.Type {System.RuntimeType} + ReturnTypeCustomAttributes {TSource } System.Reflection.ICustomAttributeProvider {System.Reflection.RuntimeParameterInfo} + Non-Public members - [1] {TSource First[TSource](System.Collections.Generic.IEnumerable`1[TSource], System.Func`2[TSource,System.Boolean])} System.Reflection.MethodInfo {System.Reflection.RuntimeMethodInfo} Attributes Public | Static | HideBySig System.Reflection.MethodAttributes CallingConvention Standard System.Reflection.CallingConventions ContainsGenericParameters true bool + CustomAttributes Count = 2 System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> {System.Collections.ObjectModel.ReadOnlyCollection<System.Reflection.CustomAttributeData>} + DeclaringType {Name = "Enumerable" FullName = "System.Linq.Enumerable"} System.Type {System.RuntimeType} IsAbstract false bool IsAssembly false bool IsConstructor false bool IsFamily false bool IsFamilyAndAssembly false bool IsFamilyOrAssembly false bool IsFinal false bool IsGenericMethod true bool IsGenericMethodDefinition true bool IsHideBySig true bool IsPrivate false bool IsPublic true bool IsSecurityCritical false bool IsSecuritySafeCritical false bool IsSecurityTransparent true bool IsSpecialName false bool IsStatic true bool IsVirtual false bool MemberType Method System.Reflection.MemberTypes MetadataToken 100665142 int + MethodHandle {System.RuntimeMethodHandle} System.RuntimeMethodHandle MethodImplementationFlags IL System.Reflection.MethodImplAttributes + Module {System.Core.dll} System.Reflection.Module {System.Reflection.RuntimeModule} Name "First" string + ReflectedType {Name = "Enumerable" FullName = "System.Linq.Enumerable"} System.Type {System.RuntimeType} + ReturnParameter {TSource } System.Reflection.ParameterInfo {System.Reflection.RuntimeParameterInfo} + ReturnType {Name = "TSource" FullName = null} System.Type {System.RuntimeType} + ReturnTypeCustomAttributes {TSource } System.Reflection.ICustomAttributeProvider {System.Reflection.RuntimeParameterInfo} + Non-Public members tp null System.Type[]den-run-ai commented on Jan 31, 2016
using pull request #126 the following proper exception is raised:
tonyroberts commented on Feb 1, 2016
thanks, that PR has been merged.
cheers,
Tony
den-run-ai commented on Feb 9, 2016
@tonyroberts @galpin I added more similar checks in #129