Skip to content

WiP: switch e.g. html/javascript template strings with embedded escape codes to raw string#395

Draft
jonasbardino wants to merge 1 commit intonextfrom
fix/invalid-escape-sequences-in-strings-with-explicit-raw-strings
Draft

WiP: switch e.g. html/javascript template strings with embedded escape codes to raw string#395
jonasbardino wants to merge 1 commit intonextfrom
fix/invalid-escape-sequences-in-strings-with-explicit-raw-strings

Conversation

@jonasbardino
Copy link
Contributor

@jonasbardino jonasbardino commented Dec 12, 2025

Switch e.g. html/javascript template strings with embedded escapescapes in them to raw strings like r"bla\*" in order to avoid DeprecationWarning(on python3.6+) orSyntaxError` (python3.12+).

Tools like bandit will warn about the existence of such strings when scanned so it can be used to locate all relevant occurrences in our code base.

It's important to validate that the raw string wrapping does not change the meaning of the code. They typically remove the need for one level of escaping as in

 > python
Python 3.12.3 (main, Nov  6 2025, 13:44:16) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> r'\.'
'\\.'

…scapes in

them to raw strings in order to avoid DeprecationWarning (on python3.6+) or
SyntaxError (python3.12+).
@jonasbardino jonasbardino self-assigned this Dec 12, 2025
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