- changed status to resolved
Spawner warnings (upcxx-run)
Issue #617
resolved
When launching upcxx executables under MacOS Sonoma
I get warnings of the following form
upcxx-run:63: SyntaxWarning: invalid escape sequence '\s'
These can be resolved via raw strings (see https://docs.python.org/3/library/re.html)
To wit, on line 63, we replace
'^\s*(\d+)\s*$' by r'^\s*(\d+)\s*$'
and so on at lines 77-79
Comments (1)
-
- Log in to comment
Prevent escape sequence warnings in upcxx-run
This commit resolves issue
#617regarding warnings from Python 3.12 about unrecognized escape sequences in upcxx-run.Starting with Python 3.12, the use of unrecognized backslash escape sequences in string literals yield warnings, and future releases are anticipated to produce errors. Since even before Python 2.7, documentation for
re
has documented use of "raw strings" as recommended for regular expressions to prevent interpretation of backslash sequences. So, this commit simply puts that recommendation in to practice for each regular expressions which contains the\s
and/or\d
sequences. Normal strings are notably still used in regular expressions which include\t
and\n
(tab and newline, respectively) where interpretation of the escape sequence is desired.→ <<cset 0f95c9e633b2>>