aboutsummaryrefslogtreecommitdiff
path: root/b4/pr.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-06-11 09:59:21 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-06-11 09:59:21 -0400
commit0a1776fc9fdf8e03757f2ccc08f5267489472432 (patch)
treef7f4dd87d6781dcb99265b5a1dd4d9bc700679e0 /b4/pr.py
parent723f4d79a6181b60f03f9573a394a85895f5cf03 (diff)
downloadb4-0a1776fc9fdf8e03757f2ccc08f5267489472432.tar.gz
Save mbox files with proper unixfrom
In order to avoid some of the more obscure charset encoding problems, we switched to using as_string() for generating messages before saving them in an mbox file. However, this uncovered a bug where the unixfrom was not actually generated and saved, despite as_bytes() and as_string() supposedly behaving identically. See: https://docs.python.org/3/library/email.message.html#email.message.EmailMessage.as_string This commit fixes the problem by properly setting the unixfrom and using the recommended (and hopefully less buggy) email.generator interface when saving mailboxes. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/pr.py')
-rw-r--r--b4/pr.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/b4/pr.py b/b4/pr.py
index f0d990e..c5c5fc7 100644
--- a/b4/pr.py
+++ b/b4/pr.py
@@ -586,7 +586,7 @@ def main(cmdargs):
if save_maildir:
b4.save_maildir(msgs, savefile)
else:
- with open(savefile, 'wb') as fh:
+ with open(savefile, 'w') as fh:
b4.save_git_am_mbox(msgs, fh)
logger.info('---')
logger.info('Saved %s', savefile)