From 62d81b7610b8b00ffcc1fa9efce4ea81b1a72e2c Mon Sep 17 00:00:00 2001 From: Joseph Marie Alba Date: Sun, 16 May 2021 05:59:47 +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 RegEx pattern as a raw string instead by prepending r --- frappe/utils/file_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/utils/file_manager.py b/frappe/utils/file_manager.py index e165a4e338..2177e67274 100644 --- a/frappe/utils/file_manager.py +++ b/frappe/utils/file_manager.py @@ -418,7 +418,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