Fix #155996: Crash calling operators with non-string keywords

Resolve regression in [0] which didn't account for the move to our
own callable type needing to validate the key types in the keyword dict.

Add `PyC_Dict_CheckKeysAreStrings` utility to allow reuse for
callable types in the future.

[0]: 877283a09a

Ref !155997
This commit is contained in:
Campbell Barton 2026-03-20 18:18:14 +11:00
parent 216c095d5d
commit 177ce52e34
4 changed files with 38 additions and 0 deletions

View file

@ -108,6 +108,11 @@ class TestOperatorCallKeywordArgsInvalid(unittest.TestCase):
with self.assertRaises(TypeError):
bpy.ops.object.select_all(action='')
def test_non_string_keywords(self):
for key in (1, None, (1, 2)):
with self.assertRaises(TypeError):
bpy.ops.object.select_all(**{key: 'TOGGLE'})
class TestOperatorCallInvalid(unittest.TestCase):