From f7b77a89f46b7272d4b7b95e90f14af52b48e024 Mon Sep 17 00:00:00 2001 From: Mehdi Boutayeb Date: Tue, 15 Sep 2026 09:49:18 +0200 Subject: [PATCH] Escape backslashes in common util regex apps/common/utils/common.py contains `\[` in a non-raw string literal (twice), so Python 3.12+ raises SyntaxWarning: invalid escape sequence '\['. MaxKB pins requires-python ~=3.11.0 and runs 3.11 in CI. Escaping the backslashes keeps the value identical (ruff W605-style). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw --- apps/common/utils/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/utils/common.py b/apps/common/utils/common.py index 61da80d644a..8ad7a4683fa 100644 --- a/apps/common/utils/common.py +++ b/apps/common/utils/common.py @@ -346,7 +346,7 @@ def run(*args, **kwargs): def parse_md_image(content: str): - matches = re.finditer("!\[.*?\]\(.*?\)", content) + matches = re.finditer("!\\[.*?\\]\\(.*?\\)", content) image_list = [match.group() for match in matches] return image_list @@ -414,7 +414,7 @@ def flat_map(array: List[List]): def parse_image(content: str): - matches = re.finditer("!\[.*?\]\(\.\/oss\/(image|file)\/.*?\)", content) + matches = re.finditer("!\\[.*?\\]\\(\\.\\/oss\\/(image|file)\\/.*?\\)", content) image_list = [match.group() for match in matches] return image_list