[FIX] web: /web/binary/upload

Doesn't seem used since it's been broken forever on python 3:
base64.b64encode returns binary data, on which json.dumps chokes.

Still, removing the endpoint on old stables seems a bit brutal so just
fix it.

closes odoo/odoo#56650

X-original-commit: 7fc9bc28986d69184df5a4fdeefbe09e4b39b8f0
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Xavier Morel
2020-08-27 11:22:02 +00:00
parent bc5654f0a4
commit f051a2f969
+1 -1
View File
@@ -1544,7 +1544,7 @@ class Binary(http.Controller):
try:
data = ufile.read()
args = [len(data), ufile.filename,
ufile.content_type, base64.b64encode(data)]
ufile.content_type, pycompat.to_text(base64.b64encode(data))]
except Exception as e:
args = [False, str(e)]
return out % (json.dumps(callback), json.dumps(args)) if callback else json.dumps(args)