From 66fffc96cac0030b6689fa9c456bafd625e2f3c1 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Sun, 20 Aug 2017 11:33:35 +0200 Subject: [PATCH] [FIX] P3: text regex patterns only work with text input .. not bytes --- addons/mail/models/mail_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 3675ca26332..182e3d6a19c 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -744,7 +744,7 @@ class Message(models.Model): values['attachment_ids'].append((4, attachment.id)) data_to_url[key] = '/web/image/%s' % attachment.id return '%s%s alt="%s"' % (data_to_url[key], match.group(3), name) - values['body'] = _image_dataurl.sub(base64_to_boundary, values['body']) + values['body'] = _image_dataurl.sub(base64_to_boundary, tools.ustr(values['body'])) message = super(Message, self).create(values) message._invalidate_documents()