If a validator handler raise a TypeError hug catch it believing (here) that’s is an expected error unexpected keyword argument "context"
A solution is to use replace initialize_handler code with something like that:
import inspect
def initialize_handler(handler, value, context):
if "context" in inspect.signature(handler).parameters: # It's better to ask for permission than for forgiveness
return handler(value, context=context)
else:
return handler(value)
If a validator handler raise a
TypeError
hug catch it believing (here) that’s is an expected errorunexpected keyword argument "context"
A solution is to use replace
initialize_handler
code with something like that: