changeset 6774:cce5a8388cde stable

email: don't crash on sending mails with unicode comments without appropriate environment configuration (Issue #275) For example, on Linux, running `gearbox serve` with LANG=C, would crash in: File ".../kallithea/lib/celerylib/tasks.py", line 307, in send_email % (' '.join(recipients), headers, subject, body, html_body)) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 224: ordinal not in range(128) Replacing render with render_unicode works in this case ... but there might be other problems elsewhere.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 30 May 2017 02:59:45 +0200
parents 9a773d2f022b
children d9cd86e552b5
files kallithea/model/notification.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/notification.py	Mon Jan 23 02:17:38 2017 +0900
+++ b/kallithea/model/notification.py	Tue May 30 02:59:45 2017 +0200
@@ -340,4 +340,4 @@
                    'c': c}
         _kwargs.update(kwargs)
         log.debug('rendering tmpl %s with kwargs %s', base, _kwargs)
-        return email_template.render(**_kwargs)
+        return email_template.render_unicode(**_kwargs)