Files
leoca baec853a93 [tools] Fix invalid escape sequence warnings in Python scripts
Running tools/run_perf.py or the presubmit with Python 3.12 prints
"SyntaxWarning: invalid escape sequence" for regexes written as plain
string literals, the same problem crrev.com/c/7580173 fixed in
test/benchmarks/csuite/benchmark.py. Compiling every tracked .py file
with warnings enabled still reports 29 such escapes in 14 files, and
Python has announced that they will eventually become a SyntaxError.

This turns them into raw strings. In sancov_formatter.py the literals
also contained \' so they become double-quoted raw strings, and in
mb_test.py the Windows path only gets its remaining backslashes doubled.

Nothing should change at runtime. I compared the AST of each file
before and after: all string values are identical except four patterns
in v8_presubmit.py where "\n" becomes r"\n", and those compile to the
same regex bytecode. After the change no tracked .py file emits a
SyntaxWarning.

AI tools used

Change-Id: If33347a100847ac0d7506206bf909662b0258524
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8400127
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Matthias Liedtke <mliedtke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#109806}
2026-09-14 03:21:32 -07:00
..
2023-08-18 19:13:45 +00:00
2023-08-24 11:27:28 +00:00
2022-03-15 11:09:49 +00:00
2023-08-18 19:13:45 +00:00
2022-03-15 11:09:49 +00:00