From ab4ecfee68a99048556d1e5c6a6d86e610ce563c Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 2 Oct 2015 19:07:04 +0000 Subject: [PATCH] Treate template as unicode, but explicitly encode to utf-8 to avoid implicit coercion to ascii. --- roles/koji_reminder/files/koji-cert-reminder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/koji_reminder/files/koji-cert-reminder.py b/roles/koji_reminder/files/koji-cert-reminder.py index 99f8c5fbfc..21f56769ac 100644 --- a/roles/koji_reminder/files/koji-cert-reminder.py +++ b/roles/koji_reminder/files/koji-cert-reminder.py @@ -29,7 +29,7 @@ datagrepper_url = 'https://apps.fedoraproject.org/datagrepper/raw' from_address = 'admin@fedoraproject.org' mail_server = 'bastion.phx2.fedoraproject.org' -message_template = """{human_name}/{username}: +message_template = u"""{human_name}/{username}: This is an automated email sent to inform you that your Fedora Project Koji certificate is about to expire. Koji certificates are valid for 6 months and @@ -134,7 +134,7 @@ def send_email(user, last_change): change_date=last_change.format('YYYY-MM-DD'), **user ) - message.set_payload(content) + message.set_payload(content.encode('utf-8')) server = smtplib.SMTP(mail_server) server.sendmail(