Skip to content

Fix Python 3.12+ SyntaxWarning: invalid escape sequence in banner and -f help - #48

Open
MBK-fr wants to merge 1 commit into
m8sec:masterfrom
MBK-fr:fix/py312-invalid-escape
Open

MBK-fr wants to merge 1 commit into
m8sec:masterfrom
MBK-fr:fix/py312-invalid-escape

Conversation

@MBK-fr

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

Copy link
Copy Markdown

What

crosslinked/__init__.py has a non raw banner string with backslash ASCII art (\_, \/, \.) and an argparse help string containing \{.

Why

On Python 3.12+ these emit SyntaxWarning: invalid escape sequence when CrossLinked is imported, and CPython has scheduled them to become a SyntaxError in a future release.

Fix

Only the backslashes that form an invalid escape are doubled, so the rendered banner and the -f help text are byte for byte identical. Verified: string-constant multiset unchanged before/after, and python3 -W error::SyntaxWarning -m py_compile crosslinked/__init__.py is clean.

…hon 3.12+)

crosslinked/__init__.py contains a non-raw banner string with backslash art
(\_, \/, \.) and an argparse help string with \{. On Python 3.12+ these
emit SyntaxWarning: invalid escape sequence and are scheduled to become a
SyntaxError in a future release.

Only the backslashes forming an invalid escape are doubled, so the printed
banner and help text are byte-for-byte identical.
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.

1 participant