diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-10-01 15:21:16 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-10-01 15:25:11 -0400 |
commit | 30adcab2456c1a8b0e48db5c4b5b4fe50f84ca69 (patch) | |
tree | 6ec10cdbe6f55e7165ce56a124aaa72c11711d4d | |
parent | 347edcdd1e7104484777e286ed30f327de17ff8d (diff) | |
download | b4-30adcab2456c1a8b0e48db5c4b5b4fe50f84ca69.tar.gz |
Set charset in order to generate MIME headers
Apparently, merely passing policy= doesn't generate the full set of
required headers, so make sure we do set_charset('utf-8').
Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/ty.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -426,9 +426,9 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'): outgoing += 1 outfile = os.path.join(outdir, '%s.thanks' % slug) logger.info(' Writing: %s', outfile) - bout = msg.as_string(policy=b4.emlpolicy) + msg.set_charset('utf-8') with open(outfile, 'wb') as fh: - fh.write(bout.encode('utf-8')) + fh.write(msg.as_bytes()) logger.debug('Cleaning up: %s', jsondata['trackfile']) fullpath = os.path.join(datadir, jsondata['trackfile']) os.rename(fullpath, '%s.sent' % fullpath) |