summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patchwork/parser.py1
-rw-r--r--patchwork/tests/test_parser.py2
-rw-r--r--releasenotes/notes/issue-197-4f7594db1e4c9887.yaml7
3 files changed, 10 insertions, 0 deletions
diff --git a/patchwork/parser.py b/patchwork/parser.py
index d6fa843..946b668 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -47,6 +47,7 @@ class DuplicateMailError(Exception):
def normalise_space(value):
+ value = ''.join(re.split(r'\n\s+', value))
whitespace_re = re.compile(r'\s+')
return whitespace_re.sub(' ', value).strip()
diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py
index a9df5e3..664edd5 100644
--- a/patchwork/tests/test_parser.py
+++ b/patchwork/tests/test_parser.py
@@ -832,6 +832,8 @@ class SubjectTest(TestCase):
self.assertEqual(clean_subject('[PATCH] meep'), ('meep', []))
self.assertEqual(clean_subject("[PATCH] meep \n meep"),
('meep meep', []))
+ self.assertEqual(clean_subject("[PATCH] meep,\n meep"),
+ ('meep,meep', []))
self.assertEqual(clean_subject('[PATCH RFC] meep'),
('[RFC] meep', ['RFC']))
self.assertEqual(clean_subject('[PATCH,RFC] meep'),
diff --git a/releasenotes/notes/issue-197-4f7594db1e4c9887.yaml b/releasenotes/notes/issue-197-4f7594db1e4c9887.yaml
new file mode 100644
index 0000000..2777fbc
--- /dev/null
+++ b/releasenotes/notes/issue-197-4f7594db1e4c9887.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ Long headers can be wrapped using CRLF followed by WSP (whitespace). This
+ whitespace was not being stripped, resulting in errant whitespace being
+ saved for the patch subject. This is resolved though existing patches and
+ cover letters will need to be updated manually.