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