From: Catalin Marinas Date: Mon, 20 Jul 2009 09:16:22 +0000 (+0100) Subject: Handle multi-line Subject header better X-Git-Tag: v0.15-rc2~18 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/d8846ff468b71be414ef40d17b16cb18773b3c21 Handle multi-line Subject header better 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 --- 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