aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-15 08:56:41 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-12-15 09:00:55 -0500
commit95bd0c91c2a84b25a3f809500a1351a93ee97e4f (patch)
treef52666f0a365f7491f08fbe4d499f8bf071bdaaa
parent770e31056d1b5c7580769c5aa916580827c47041 (diff)
downloadb4-95bd0c91c2a84b25a3f809500a1351a93ee97e4f.tar.gz
Convert mboxrd to mboxo
Public-inbox emits mboxrd, but Python only understands mboxo, so we need to convert from mboxrd to mboxo before passing the retrieved results to mailbox.mbox. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/CAHk-=whRm2sKHeY-YQqxEJF=d9fGhnU2ajJs9i7CKC4feuPMTA@mail.gmail.com Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index b8d3191..5cb5a60 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -2268,6 +2268,8 @@ def get_pi_thread_by_url(t_mbx_url, savefile, nocache=False):
if not len(t_mbox):
logger.critical('No messages found for that query')
return None
+ # Convert mboxrd to mboxo that python understands
+ t_mbox = t_mbox.replace(b'\n>>From ', b'\n>From ')
with open(savefile, 'wb') as fh:
logger.debug('Saving %s', savefile)
fh.write(t_mbox)