summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic/basic_controller.js
diff options
context:
space:
mode:
authoralexkuhn <alexkuhn@users.noreply.github.com>2017-10-16 16:30:54 +0200
committerGitHub <noreply@github.com>2017-10-16 16:30:54 +0200
commit44b3491450691aded18597c1169c5652570c7358 (patch)
treeecf8dbaa5f5b060cf0a24b361e02150d40d25c70 /addons/web/static/src/js/views/basic/basic_controller.js
parent3315c7c727cf3db258d1e5a4d5605a49d74eab4b (diff)
[FIX][P3] base, tools: prevent crash when importing translation .po file (#20191)
With Odoo v11 running on Python3: 1. Go to Settings -> Translation -> Import Translation 2. Choose a valid .po file (e.g. generated with the menu Export Translation) 3. Click Import There is a server error. There are two bugs behind this error: 1. we open a temporary file that cannot insert bytes ('w+') 2. the name of the temporary file is an integer (its file descriptor) Python2 processed some implicit conversion between str and bytes, so that the 1st error doesn't occur. The name of a temporary file in Python2 is '<fopen>'. We made the following corrections to the code: 1. open the temporary file with w+b access (write bytes) 2. enhanced a conditional statement so that we skip instructions in case where the field name of the tempfile is a string Related Ticket: opw-775445
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions