diff options
| author | David Arnold <dar@xoe.solutions> | 2019-07-10 12:44:58 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2019-07-30 06:41:09 +0000 |
| commit | a69b4653c5e182e00492a69a0dbe33a45a983f5c (patch) | |
| tree | 4756b5572e80dc4eaa000a8b2c6dec33ca021789 /addons | |
| parent | 263e980817ef2a1f35ba3162eddb4fcbf267cff0 (diff) | |
[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) <xmo@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/controllers/main.py | 4 |
1 files 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: |
