# HG changeset patch # User Mads Kiilerich # Date 1496105985 -7200 # Node ID fbc588a09811dfb42ffded83ee2b4a9e3da7feb3 # Parent a4715df4029954d99507255c7eb602dd260ae374 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. diff -r a4715df40299 -r fbc588a09811 kallithea/model/notification.py --- a/kallithea/model/notification.py Tue May 30 02:59:45 2017 +0200 +++ b/kallithea/model/notification.py Tue May 30 02:59:45 2017 +0200 @@ -342,4 +342,4 @@ }) log.debug('rendering tmpl %s with kwargs %s', base, _kwargs) - return email_template.render(**_kwargs) + return email_template.render_unicode(**_kwargs)