From: Stephen Finucane Date: Wed, 24 May 2017 05:54:55 +0000 (+0100) Subject: parser: Strip whitespace from references X-Git-Tag: v2.0.0-rc3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6763667ffc1012bd544d2b08d342c4a5abef80d9;p=thirdparty%2Fpatchwork.git parser: Strip whitespace from references Some mail, particularly those generated with older versions of git-send-email or written by hand, include some extra whitespace in the 'References' and 'In-Reply-To' lines. Ensure we always strip this, preventing mismatches between this and 'Message-ID', which is already stripped of whitespace, when looking up SeriesReference's. Signed-off-by: Stephen Finucane --- diff --git a/patchwork/parser.py b/patchwork/parser.py index 28b3a072..f56053b8 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -339,12 +339,13 @@ def find_references(mail): refs = [] if 'In-Reply-To' in mail: - refs.append(mail.get('In-Reply-To')) + refs.append(mail.get('In-Reply-To').strip()) if 'References' in mail: rs = mail.get('References').split() rs.reverse() for r in rs: + r = r.strip() if r not in refs: refs.append(r)