summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-02 21:12:25 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-10-02 21:16:21 -0400
commit81f21c696edc1396115250ffb06e8a39da366015 (patch)
treeb27115b0bd47b551b0a2ef39f13124ed08a955ee
parentbb3e0204972e720185e4693c5779eef5f6b49907 (diff)
downloadb4-81f21c696edc1396115250ffb06e8a39da366015.tar.gz
Fix header encoding introduced by earlier fix
It seems we don't have much control over what as_bytes() does, so switch to using as_string(), setting our policy, and making sure that content-transfer-encoding is set to 8bit. Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ty.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/b4/ty.py b/b4/ty.py
index cbee06a..83209eb 100644
--- a/b4/ty.py
+++ b/b4/ty.py
@@ -427,8 +427,9 @@ def send_messages(listing, gitdir, outdir, branch, since='1.week'):
outfile = os.path.join(outdir, '%s.thanks' % slug)
logger.info(' Writing: %s', outfile)
msg.set_charset('utf-8')
- with open(outfile, 'wb') as fh:
- fh.write(msg.as_bytes())
+ msg.replace_header('Content-Transfer-Encoding', '8bit')
+ with open(outfile, 'w') as fh:
+ fh.write(msg.as_string(policy=b4.emlpolicy))
logger.debug('Cleaning up: %s', jsondata['trackfile'])
fullpath = os.path.join(datadir, jsondata['trackfile'])
os.rename(fullpath, '%s.sent' % fullpath)