Skip to content

Escape backslashes in common util regex - #7049

Closed
MBK-fr wants to merge 1 commit into
1Panel-dev:v2from
MBK-fr:fix/invalid-escape-sequence-syntaxwarning
Closed

MBK-fr wants to merge 1 commit into
1Panel-dev:v2from
MBK-fr:fix/invalid-escape-sequence-syntaxwarning

Conversation

@MBK-fr

@MBK-fr MBK-fr commented Sep 15, 2026

Copy link
Copy Markdown

Problem

apps/common/utils/common.py contains \[ in a non-raw string literal (two occurrences), so Python 3.12+ raises SyntaxWarning: invalid escape sequence '\[' on import.

Why it matters for MaxKB

MaxKB pins requires-python ~=3.11.0 and runs Python 3.11 in CI; the warning surfaces on import.

Fix

Escape the backslashes; the value is byte-for-byte identical (ruff W605-style).

Verification

In-memory compile() under -W error is clean after (raised before); AST unchanged. Targets the v2 branch (the repo's default).


🤖 Generated with Claude Code

https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw
@liuruibin

Copy link
Copy Markdown
Member

no plan

@liuruibin liuruibin closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants