diff --git a/frappe/tests/test_utils.py b/frappe/tests/test_utils.py index 59df08dd91..ad3367862e 100644 --- a/frappe/tests/test_utils.py +++ b/frappe/tests/test_utils.py @@ -972,4 +972,5 @@ class TestTBSanitization(FrappeTestCase): traceback = frappe.get_traceback(with_context=True) self.assertNotIn("42", traceback) self.assertIn("********", traceback) + self.assertIn("password =", traceback) self.assertIn("safe_value", traceback) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index d37e8c201f..5d1aed259a 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -346,7 +346,7 @@ def _get_traceback_sanitizer(): return Format( custom_var_printers=[ # redact variables - *[(variable_name, lambda: placeholder) for variable_name in blocklist], + *[(variable_name, lambda *a, **kw: placeholder) for variable_name in blocklist], # redact dictionary keys (["_secret", dict, lambda *a, **kw: False], dict_printer), ],