From d8846ff468b71be414ef40d17b16cb18773b3c21 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 20 Jul 2009 10:16:22 +0100 Subject: [PATCH] Handle multi-line Subject header better Organization: Straylight/Edgeware From: Catalin Marinas It looks like not all multi-line Subject headers are split with \n\t. This is causing an exception with the re.findall() calll in stgit.commands.common.parse_mail() function. Use re.sub() instead of replace(). Signed-off-by: Catalin Marinas --- stgit/commands/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stgit/commands/common.py b/stgit/commands/common.py index bc8266e..23ba4b3 100644 --- a/stgit/commands/common.py +++ b/stgit/commands/common.py @@ -405,7 +405,8 @@ def parse_mail(msg): authname = authemail = None # '\n\t' can be found on multi-line headers - descr = __decode_header(msg['subject']).replace('\n\t', ' ') + descr = __decode_header(msg['subject']) + descr = re.sub('\n[ \t]*', ' ', descr) authdate = msg['date'] # remove the '[*PATCH*]' expression in the subject -- [mdw]