From a9d8d5983382b22a80dbcd1d9266c2df816b3929 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 17 May 2017 10:56:21 +0200 Subject: [PATCH] [FIX] P3: error messages are text, dump XML docs as text --- odoo/tools/convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index fec641c619c..86697b2b4d2 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -600,7 +600,7 @@ form: module.record_id""" % (xml_id,) ' xmltag: %s\n' \ ' expected value: %r\n' \ ' obtained value: %r\n' \ - % (rec_string, etree.tostring(test), expected_value, expression_value) + % (rec_string, etree.tostring(test, encoding='unicode'), expected_value, expression_value) _logger.error(msg) return else: # all tests were successful for this assertion tag (no break) @@ -788,7 +788,7 @@ form: module.record_id""" % (xml_id,) exc_info = sys.exc_info() pycompat.reraise( ParseError, - ParseError(ustr(e), etree.tostring(rec).rstrip(), rec.getroottree().docinfo.URL, rec.sourceline), + ParseError(ustr(e), etree.tostring(rec, encoding='unicode').rstrip(), rec.getroottree().docinfo.URL, rec.sourceline), exc_info[2] ) return True