From 6f1a6e4b4a54159eed17668ab66d5ee66a538731 Mon Sep 17 00:00:00 2001 From: Martijn van de Streek Date: Fri, 11 Mar 2022 00:35:07 +0100 Subject: [PATCH] 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 --- outlookmsgfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outlookmsgfile.py b/outlookmsgfile.py index 5ecc27a..beace51 100644 --- a/outlookmsgfile.py +++ b/outlookmsgfile.py @@ -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)\