Use a raw string in re, so \n and \s work (#23)

Newer versions of Python complain about "\s" not being correct syntax
(SyntaxError during import); changing the string to a raw string fixes
the issue.

Co-authored-by: Martijn van de Streek <martijn.vandestreek@exxellence.nl>
This commit is contained in:
Martijn van de Streek
2022-03-11 00:35:07 +01:00
committed by GitHub
parent 5fa8976f86
commit 6f1a6e4b4a
+1 -1
View File
@@ -54,7 +54,7 @@ def load_message_stream(entry, is_top_level, doc):
# way is just the plain-text portion of the email and whatever
# Content-Type header was in the original is not valid for
# reconstructing it this way.
headers = re.sub("Content-Type: .*(\n\s.*)*\n", "", headers, flags=re.I)
headers = re.sub(r"Content-Type: .*(\n\s.*)*\n", "", headers, flags=re.I)
# Parse them.
headers = email.parser.HeaderParser(policy=email.policy.default)\