From 9ad04d4e9bfc34e3069ec164f2f6c4a4c88313ca Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 24 Jun 2013 14:28:42 +0200 Subject: [PATCH] [FIX] report_webkit: writing to disk implies having bytes to write, convert the unicode Jinja2 output to UTF-8 Jinja2 always returns unicode strings http://jinja.pocoo.org/docs/api/#jinja2.Template.render bzr revid: odo@openerp.com-20130624122842-8gs8by3k8jn7bffx --- addons/report_webkit/webkit_report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 15f88b6e878..fd34aa99315 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -173,7 +173,7 @@ class WebKitParser(report_sxw): ), 'w' ) - head_file.write(header) + head_file.write(header.encode('utf-8')) head_file.close() file_to_del.append(head_file.name) command.extend(['--header-html', head_file.name]) @@ -184,7 +184,7 @@ class WebKitParser(report_sxw): ), 'w' ) - foot_file.write(footer) + foot_file.write(footer.encode('utf-8')) foot_file.close() file_to_del.append(foot_file.name) command.extend(['--footer-html', foot_file.name]) @@ -205,7 +205,7 @@ class WebKitParser(report_sxw): for html in html_list : html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w') count += 1 - html_file.write(html) + html_file.write(html.encode('utf-8')) html_file.close() file_to_del.append(html_file.name) command.append(html_file.name)