From 126ecbb29bfbc923859c7e66a6cbdc91d25dfbfc Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 11 Jun 2018 22:26:02 +0300 Subject: Fix: handle non-ASCII build logs in notification mails --- ick2/sendmail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ick2/sendmail.py b/ick2/sendmail.py index 0b0d34e..423b9f6 100644 --- a/ick2/sendmail.py +++ b/ick2/sendmail.py @@ -85,8 +85,8 @@ class Sendmail: def get_log(self, log): msg = email.message.Message() - msg.set_payload(log) - msg.add_header('Content-Type', 'text/plain') + msg.set_payload(log.encode('utf-8')) + msg.add_header('Content-Type', 'text/plain; charset=utf-8') msg.add_header( 'Content-Disposition', 'inline', filename='build.log') return msg -- cgit v1.2.1