diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 1907064bd6b..061c1c57926 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -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)