Skip to content

PSA v1.6.0 and v1.7.1 fail to load in Blender 4.2 with RuntimeError: dictionary changed size during iteration #113

Description

@mattrenderedai

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

  1. Download PSA v1.6.0 or v1.7.1 from Physical Addons
  2. Install the addon in Blender 4.2: Edit > Preferences > Add-ons > Install > Select the .zip file
  3. Enable the addon by checking the checkbox next to "Physical Starlight and Atmosphere"
  4. Observe the error in the console: RuntimeError: dictionary changed size during iteration

Screenshots
[If applicable, add screenshots to help explain your problem.]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions