I have this code in my addon. It just runs view_all() operator from another context.
for area in context.screen.areas:
if area.type == 'DOPESHEET_EDITOR':
for region in area.regions:
if region.type == 'WINDOW':
ctx = context.copy()
ctx['area'] = area
ctx['region'] = region
bpy.ops.action.view_all(ctx)
break
break
It works perfectly fine in 3.3 or 3.6 but with 4.0 it gives me the error below:
line 76, in execute
bpy.ops.action.view_all(ctx)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 106, in __call__
C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 60, in _parse_args
raise ValueError("1-2 args execution context is supported")
ValueError: 1-2 args execution context is supported
I couldn't find any braking change in the API that would cause this and I have no idea why it's not working.