[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user