From 8e1ab164411deb81b89a690ef1d61770f3c0cb09 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Mon, 30 Oct 2017 16:18:04 +0100 Subject: [PATCH] [FIX] core: mode of output file for t9n export trans_export has been decided to use a *bytes* output buffer as some of the output formats are text-ish (e.g. po) but others are definitely binary content (e.g. XML). Therefore, when calling trans_export with a *file*, it needs to be open in *binary mode*. Fixes #20555 --- odoo/cli/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/cli/server.py b/odoo/cli/server.py index d740dc7282a..7c6ccd30b54 100644 --- a/odoo/cli/server.py +++ b/odoo/cli/server.py @@ -98,7 +98,7 @@ def export_translation(): fileformat = os.path.splitext(config["translate_out"])[-1][1:].lower() - with open(config["translate_out"], "w") as buf: + with open(config["translate_out"], "wb") as buf: registry = odoo.modules.registry.Registry.new(dbname) with odoo.api.Environment.manage(): with registry.cursor() as cr: