From 86c27b7156df7c44ed7198a4f27eb10ebe8a44df Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Mon, 11 Oct 2021 13:54:37 +0000 Subject: [PATCH] [FIX] core: lower_logging record.args not str MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per the logging documentation, it is fine to send arguments that are not string. Logging takes care of stringifying and injecting the arguments in the message template. closes odoo/odoo#78172 Signed-off-by: Xavier Dollé (xdo) --- odoo/tools/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 936a6b1c47d..9d0adefe8e5 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -836,7 +836,7 @@ class lower_logging(logging.Handler): record.levelname = f'_{record.levelname}' record.levelno = self.max_level self.had_error_log = True - record.args = tuple(arg.replace('Traceback (most recent call last):', '_Traceback_ (most recent call last):') for arg in record.args) + record.args = tuple(arg.replace('Traceback (most recent call last):', '_Traceback_ (most recent call last):') if type(arg) is str else arg for arg in record.args) # pylint: disable=unidiomatic-typecheck for handler in self.old_handlers: if handler.level <= record.levelno: