[Bf-blender-cvs] [4adc68bdf87] blender-v2.83-release: Fix T75973: don't show raw Python errors to users for invalid shortcut paths

Brecht Van Lommel noreply at git.blender.org
Tue Apr 28 13:00:34 CEST 2020


Commit: 4adc68bdf872c7fa1deb116159b623d689542112
Author: Brecht Van Lommel
Date:   Wed Apr 22 08:59:37 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB4adc68bdf872c7fa1deb116159b623d689542112

Fix T75973: don't show raw Python errors to users for invalid shortcut paths

There are cases when a user can accidentally assign an operator to toggle an
invalid property to e.g. left click, which shows Python errors to the users.
Rather than throw an error and e.g. break 3D viewport selection for the user,
just print an error to the console.

The root cause of such bugs should be fixed as well, but a working Blender
is most important here.

===================================================================

M	release/scripts/startup/bl_operators/wm.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 8c97157f234..70d958b9bc8 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -87,8 +87,10 @@ def context_path_validate(context, data_path):
             # One of the items in the rna path is None, just ignore this
             value = Ellipsis
         else:
-            # We have a real error in the rna path, don't ignore that
-            raise
+            # Print invalid path, but don't show error to the users and fully
+            # break the UI if the operator is bound to an event like left click.
+            print("context_path_validate error: context.%s not found (invalid keymap entry?)" % data_path)
+            value = Ellipsis
 
     return value



More information about the Bf-blender-cvs mailing list