mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-25 11:00:35 +00:00
Use raw string literals to prevent syntax warnings when using regular expressions with backslash-based patterns. The original code triggered a SyntaxWarning in developer mode (`python3 -Xdev`) due to unescaped backslash characters in regex patterns like '\s'. While CPython typically interprets these silently, strict Python parsing modes raise warnings about potentially unintended escape sequences. This change adds the `r` prefix to string literals containing regex patterns, ensuring consistent behavior across different Python runtime configurations and eliminating unnecessary syntax warning like: ``` /opt/scylladb/scripts/libexec/scylla_io_setup:41: SyntaxWarning: invalid escape sequence '\s' pattern = re.compile(_nocomment + r"CPUSET=\s*\"" + _reopt(_cpuset) + _reopt(_smp) + "\s*\"") ``` Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#21839