Force logging calls in error callback to be uninterpolated
Marco Ricci

Marco Ricci commited on 2024-12-31 22:08:02
Zeige 1 geänderte Dateien mit 2 Einfügungen und 2 Löschungen.


Remove the `args` argument to the error callback and to the underlying
`logging` function, forcing logger to skip log message interpolation in
any case.
... ...
@@ -2536,10 +2536,10 @@ def derivepassphrase_vault(  # noqa: C901,PLR0912,PLR0913,PLR0914,PLR0915
2536 2536
             )
2537 2537
         return
2538 2538
 
2539
-    def err(msg: Any, *args: Any, **kwargs: Any) -> NoReturn:  # noqa: ANN401
2539
+    def err(msg: Any, /, **kwargs: Any) -> NoReturn:  # noqa: ANN401
2540 2540
         stacklevel = kwargs.pop('stacklevel', 1)
2541 2541
         stacklevel += 1
2542
-        logger.error(msg, *args, stacklevel=stacklevel, **kwargs)
2542
+        logger.error(msg, stacklevel=stacklevel, **kwargs)
2543 2543
         ctx.exit(1)
2544 2544
 
2545 2545
     def get_config() -> _types.VaultConfig:
2546 2546