summaryrefslogtreecommitdiff
path: root/odoo
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2021-01-12 14:40:06 +0000
committerNicolas Lempereur <nle@odoo.com>2021-02-25 15:17:58 +0000
commit38983d123d171ac3cc1efacd99d9776f0ed08734 (patch)
tree81d01e16e6a8b4b88656d121686ed073d5a5faf9 /odoo
parent1b729171c5deac4fadebcff013aa061a96860b09 (diff)
[FIX] base, web_editor, website: add missing encoding on etree.tostring
Since lxml 4.5.0 that use now use libxml2 2.9.10, without it, it can crash. Here sample of content that is broken: https://drive.google.com/file/d/1gB2-jl4fabHscLjH9OZc4WZgtSEbCVj7/view?usp=sharing note: this commit is to merge 3 changes of #64526 opw-2428617 opw-2428664 closes odoo/odoo#66866 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'odoo')
-rw-r--r--odoo/addons/base/models/qweb.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/base/models/qweb.py b/odoo/addons/base/models/qweb.py
index ee7a5c4bd70..4d1009f7ad3 100644
--- a/odoo/addons/base/models/qweb.py
+++ b/odoo/addons/base/models/qweb.py
@@ -367,7 +367,7 @@ class QWeb(object):
if isinstance(document, etree._Element):
element = document
- document = etree.tostring(document)
+ document = etree.tostring(document, encoding='utf-8')
elif not document.strip().startswith('<') and os.path.exists(document):
element = etree.parse(document).getroot()
else: