From a69b4653c5e182e00492a69a0dbe33a45a983f5c Mon Sep 17 00:00:00 2001 From: David Arnold Date: Wed, 10 Jul 2019 12:44:58 +0000 Subject: [PATCH] [FIX] web: missed P3 text model change concat_xml was apparently missed during the Python 3 text model fixes, resuling in a function which usually returns ``(bytes, str)`` but in the case of an empty or missing ``file_list`` would return ``(str, str))` instead, leading to type errors in Python 3. Fix the particular case so it properly returns bytes as the "concatenation result" even when it did nothing. Fix the docstring so it properly reflects expectations as well. closes odoo/odoo#34751 Signed-off-by: Xavier Morel (xmo) --- addons/web/controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 6e9b0046d1f..3920d375c8d 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -196,11 +196,11 @@ def concat_xml(file_list): :param list(str) file_list: list of files to check :returns: (concatenation_result, checksum) - :rtype: (str, str) + :rtype: (bytes, str) """ checksum = hashlib.new('sha1') if not file_list: - return '', checksum.hexdigest() + return b'', checksum.hexdigest() root = None for fname in file_list: