diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-10-02 21:12:25 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-10-02 21:12:25 -0400 |
commit | c0910ee77a2ab92cc39c32b11994a5518e70fa9b (patch) | |
tree | e97ebfd299cfcf777570ff7f980731f93b7d191e | |
parent | 0d759ee9113b371a678c4acafffafa79570e9511 (diff) | |
download | b4-c0910ee77a2ab92cc39c32b11994a5518e70fa9b.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.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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) |