Describe the bug
The root cause is that PSA's module reloading code in init.py modifies a dictionary while iterating over it, which raises a RuntimeError in Python 3.11+. This code pattern was allowed in Python 3.10 and earlier but is now strictly prohibited.
Expected behavior The addon should load successfully without dictionary iteration errors. In Python 3.11+, modifying a dictionary during iteration raises RuntimeError. This is a breaking change from Python 3.10 and earlier.
Impact PSA v1.6.0 and v1.7.1 cannot be used in Blender 4.2 (Python 3.11) due to this Python compatibility issue. Users must manually patch the addon to use these versions.
General information
Blender version: 4.2.0 (hash a51f293548ad built 2024-07-16 06:27:02)
Addon version: 1.6.0 and 1.7.1 (both affected)
Engine: Cycles
Operating System: Linux
Other info that could be useful: Python 3.11 (Blender's bundled Python), Python 3.13 (system)
To Reproduce
- Download PSA v1.6.0 or v1.7.1 from Physical Addons
- Install the addon in Blender 4.2: Edit > Preferences > Add-ons > Install > Select the .zip file
- Enable the addon by checking the checkbox next to "Physical Starlight and Atmosphere"
- Observe the error in the console:
RuntimeError: dictionary changed size during iteration
Screenshots
[If applicable, add screenshots to help explain your problem.]
Describe the bug
The root cause is that PSA's module reloading code in init.py modifies a dictionary while iterating over it, which raises a RuntimeError in Python 3.11+. This code pattern was allowed in Python 3.10 and earlier but is now strictly prohibited.
Expected behavior The addon should load successfully without dictionary iteration errors. In Python 3.11+, modifying a dictionary during iteration raises RuntimeError. This is a breaking change from Python 3.10 and earlier.
Impact PSA v1.6.0 and v1.7.1 cannot be used in Blender 4.2 (Python 3.11) due to this Python compatibility issue. Users must manually patch the addon to use these versions.
General information
Blender version: 4.2.0 (hash a51f293548ad built 2024-07-16 06:27:02)
Addon version: 1.6.0 and 1.7.1 (both affected)
Engine: Cycles
Operating System: Linux
Other info that could be useful: Python 3.11 (Blender's bundled Python), Python 3.13 (system)
To Reproduce
RuntimeError: dictionary changed size during iterationScreenshots
[If applicable, add screenshots to help explain your problem.]