InvalidCastException: Dictionary in Rhino 8 GH Python3 Script Component

When passing a list of dictionaries to the Python3 GH Component (no type hint), I get an InvalidCastException:

System.InvalidCastException: Unable to cast object of type 'System.Collections.DictionaryEntry' to type 'System.Collections.Generic.KeyValuePair`2[System.Object,System.Object]'.
   at Rhino.Runtime.Code.Languages.PythonNet.CPythonCode.Execute(RunContext context)
   at Rhino.Runtime.Code.Code.ExecTry(RunContext context, IPlatformDocument& doc, Object& docState)
   at Rhino.Runtime.Code.Code.Run(RunContext context)

This was not the case for Rhino7’s Python2 component:

What am I missing?

Great catch! Will get of fixing it right now

RH-80321 dotnet Dictionaries sometimes fail to convert to python

1 Like

Fixed for Rhino 8.4

1 Like

RH-80321 is fixed in Rhino 8 Service Release 4

A post was split to a new topic: Grasshopper hangs with Py3 Component