From 87bd088b3ed1ce6d7cd26ea7f30b3c19c5199181 Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Wed, 28 Sep 2016 14:06:07 +1000 Subject: [PATCH] parser: subject_check needs to call clean_header When testing with headers with unencoded characters on Py3, subject_check would fail. It was getting an Header class, rather than a str/bytes, and so the regex was failing. Run clean_header to decode everything fully first. Signed-off-by: Daniel Axtens Reviewed-by: Stephen Finucane --- patchwork/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index 3619a07e..db3b898c 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -423,7 +423,7 @@ def subject_check(subject): """Determine if a mail is a reply.""" comment_re = re.compile(r'^(re)[:\s]\s*', re.I) - return comment_re.match(subject) + return comment_re.match(clean_header(subject)) def clean_content(content): -- 2.47.3