Index: lnt/lnttool/main.py =================================================================== --- lnt/lnttool/main.py +++ lnt/lnttool/main.py @@ -270,7 +270,8 @@ % (config.zorgURL, database, testsuite) subject = "Daily Report: %04d-%02d-%02d" % ( report.year, report.month, report.day) - html_report = report.render(ts_url, only_html_body=False).encode('utf-8') + html_report = report.render(ts_url, only_html_body=False) + utf8_html_report = html_report.encode('utf-8') if subject_prefix is not None: subject = "%s %s" % (subject_prefix, subject) @@ -280,7 +281,7 @@ msg['Subject'] = subject msg['From'] = from_address msg['To'] = address - msg.attach(email.mime.text.MIMEText(html_report, 'html', 'utf-8')) + msg.attach(email.mime.text.MIMEText(utf8_html_report, 'html', 'utf-8')) # Send the report. if not dry_run: @@ -355,9 +356,11 @@ env = lnt.server.ui.app.create_jinja_environment() text_template = env.get_template('reporting/run_report.txt') - text_report = text_template.render(data).encode('utf-8') + text_report = text_template.render(data) + utf8_text_report = text_report.encode('utf-8') html_template = env.get_template('reporting/run_report.html') - html_report = html_template.render(data).encode('utf-8') + html_report = html_template.render(data) + utf8_html_report = html_report.encode('utf-8') subject = data['subject'] if subject_prefix is not None: @@ -368,8 +371,8 @@ msg['Subject'] = subject msg['From'] = from_address msg['To'] = to_address - msg.attach(email.mime.text.MIMEText(text_report, 'plain', 'utf-8')) - msg.attach(email.mime.text.MIMEText(html_report, 'html', 'utf-8')) + msg.attach(email.mime.text.MIMEText(utf8_text_report, 'plain', 'utf-8')) + msg.attach(email.mime.text.MIMEText(utf8_html_report, 'html', 'utf-8')) # Send the report. if not dry_run: