From 95bb5e55990f898365bac8bd09174d2891d3a46f Mon Sep 17 00:00:00 2001 From: Joseph Marie Alba Date: Sun, 16 May 2021 05:55:35 +0800 Subject: [PATCH] Python 3 issue with re Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character. Declare your pattern as a raw string instead by prepending r --- frappe/core/doctype/file/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/core/doctype/file/file.py b/frappe/core/doctype/file/file.py index d6923c0010..c4c37e6d13 100755 --- a/frappe/core/doctype/file/file.py +++ b/frappe/core/doctype/file/file.py @@ -912,7 +912,7 @@ def extract_images_from_html(doc, content): return ']*src\s*=\s*["\'](?=data:)(.*?)["\']', _save_file, content) + content = re.sub(r']*src\s*=\s*["\'](?=data:)(.*?)["\']', _save_file, content) return content