[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>
This commit is contained in:
committed by
Xavier Morel
parent
263e980817
commit
a69b4653c5
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user