Skip to content

Escape backslashes in legacy research scripts (SyntaxWarning) - #76

Merged
microprediction merged 1 commit into
microprediction:mainfrom
MBK-fr:fix/invalid-escape-sequence-syntaxwarning
Sep 13, 2026
Merged

Escape backslashes in legacy research scripts (SyntaxWarning)#76
microprediction merged 1 commit into
microprediction:mainfrom
MBK-fr:fix/invalid-escape-sequence-syntaxwarning

Conversation

@MBK-fr

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

Copy link
Copy Markdown
Contributor

Problem

Three scripts under research/legacy_skatervaluation/ use non-raw string literals with invalid escapes:

  • battleutil/interpretingelo.py - \d (regex)
  • battlelatex/tables.py - \g (LaTeX fragment in a plain string)
  • schurcomparisonutil/schurportpaperutils.py - \g (matplotlib title)

Python 3.12+ raises SyntaxWarning: invalid escape sequence for each.

Why it matters for precise

The CI matrix spans Python 3.9-3.13; the warnings surface on import during the 3.12/3.13 jobs.

Fix

Double the backslashes so each string value is identical (ruff W605-style). None of these literals contain a valid escape, so there is no behaviour change.

Verification

ast.dump unchanged per file; python3 -W error py_compile passes on all three after, failed before.


🤖 Generated with Claude Code

https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw

Three scripts under research/legacy_skatervaluation use non-raw string
literals with invalid escapes (\d in interpretingelo.py, \g LaTeX
sequences in tables.py and schurportpaperutils.py). Python 3.12+ raises
`SyntaxWarning: invalid escape sequence` on import, and precise's CI
matrix spans 3.9-3.13. Escaping the backslashes leaves each string's
value unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HBQNzAf5C2E3MiJC48HQw
@microprediction
microprediction merged commit c6563f5 into microprediction:main Sep 13, 2026
@microprediction

Copy link
Copy Markdown
Owner

thanks

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