[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
This commit is contained in:
xmo-odoo
2017-10-30 16:18:04 +01:00
committed by GitHub
parent e8dc72fd69
commit 8e1ab16441
+1 -1
View File
@@ -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: