Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pvesh: Fix invalid string escape sequences
In Python, only a [limited set of characters][0] can be escaped with a backslash. In recent versions of Python, attempting to escape a non-escapeable character [raises a SyntaxWarning][1], polluting the playbook output with warnings like: <unknown>:59: SyntaxWarning: invalid escape sequence '\(' <unknown>:60: SyntaxWarning: invalid escape sequence '\.' <unknown>:61: SyntaxWarning: invalid escape sequence '\.' This commit adds the string literal prefix 'r' to regular expressions in pvesh.py to ensure that escape sequences are not interpreted in the given strings. As there were no valid escape sequences in those strings to begin with, the actual string content remains the same. [0]: https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences [1]: python/cpython#98401
- Loading branch information