Regression: bpy.utils.register_class() "can't run in readonly state" error when run from Text Editor #112461
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112461
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 536.40
Blender Version
Broken: version: 4.0.0 Alpha, branch: main, commit date: 2023-09-10 22:17, hash:
fca8df9415b1
Worked: 4.0.0 Alpha, branch: main, commit date: 2023-09-01 21:43, hash
de09bdb510a0
Short description of error
Running
bpy.utils.register_class()
from the Text Editor raisesRuntimeError: register_class(...): can't run in readonly state 'TestOp'
.Running from the Python Console instead has no issues.
Exact steps for others to reproduce the error
Run in the Text Editor (or use and run one of the many Python Templates in the Text Editor that also use
bpy.utils.register_class()
):bpy.utils.register_class() "can't run in readonly state" error when run from Text Editorto Regression: bpy.utils.register_class() "can't run in readonly state" error when run from Text EditorI can not reproduce this.
Hmm, now I can't reproduce it either. I've tried retracing my steps from the console log last night, I just did a few FBX exports with different material setups and imports to see what the exported results looked like, but no luck there either.
Hi, Any updates?
It hasn't occurred since and I couldn't see anything clearly wrong from the relevant C code. Maybe it was an unlucky hardware bitflip.
Thanks, I think we can close this report for now. If you find anything relevant, feel free to reopen 🙂
I've experienced this today using 4.1 last nights build. Every installed addon's unregister function threw the can't run in read only mode.
I had this same error and found that a modal operator was started by an addon, the operator returned
{'RUNNING_MODAL'}
, but then never finished. So the modal operator was "stuck" running forever, until I quit Blender. While it is running, no classes can be registered with Blender throughbpy.utils.register_class
.I don't completely understand why it got stuck because one way to exit the modal operator was to cancel the render. But I hit
ESC
, started a new render, etc. and nothing would end the modal operator. I don't know if the tenacity of the modality is related to this issue (112461), or just a bug in the addon code.I almost had a consistent repro working to post here, went out for a walk, came back and now it won't repro at all... Entirely frustrating!