System Information
Operating system: Windows-10-10.0.19043-SP0 64 Bits
Graphics card: GeForce GTX 960/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.66
Blender Version
Broken: version: 3.0.0, caused by rB265d97556aa0
Worked: version: 2.93.6
Short description of error
Using iter() on a ID property group returns non-iterator type IDPropertyGroupViewKeys.
Seems the change was made in rB265d97556aa0: PyAPI: use iterators for ID property methods (keys, values & items).
This example code will now produce an error while it wasn't in previous versions:
C.active_object["test"] = { "key1": "val1", "key2" : "val2", "key3": "val3" }
for key in C.active_object["test"]:
print(key)TypeError: iter() returned non-iterator of type 'IDPropertyGroupViewKeys'
I think it should return IDPropertyGroupIterKeys instead to match the python 3.x dictionary behaviour. I made a simple change (not sure if that's a valid solution): in source/blender/python/generic/idprop_py_api.c in function BPy_IDGroup_iter() changed "return BPy_IDGroup_ViewKeys_CreatePyObject(self);" to "return BPy_IDGroup_IterKeys_CreatePyObject(self, false);" and that fixed it for me.
Exact steps for others to reproduce the error
Run the script mentioned above in the python console.