Fix Python 3.14 SyntaxWarnings for invalid escape sequences#962
Conversation
|
Without the fix several warning with --help: ....... With the fix no warnings. The import error issue is fixed via separate PR ./op-test --help |
Convert regular strings with escape sequences to raw strings (r'...') to fix SyntaxWarnings that appear with Python 3.14. These warnings occur because escape sequences like \[, \(, $, \d, \w are invalid in regular strings and will not work in future Python versions. Files modified: - common/OPexpect.py: Fixed regex patterns with \[, \d - common/OpTestIPMI.py: Fixed regex patterns with \( - common/OpTestUtil.py: Fixed prompt patterns and sed commands with \[, $, \x1b - common/OpTestHost.py: Fixed regex patterns - testcases/*.py: Fixed various regex patterns and escape sequences All changes use raw strings (r'...') which treat backslashes literally, making them suitable for regex patterns and shell commands. The changes are backward compatible with older Python versions. Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
|
Rebased to latest master. There was an additional/unwanted file included in the commit. Updated the code to correct it. |
|
Thanks for PR @sacsant but it seems not needed as the master branch has fix .. Closing this PR .. If you again face an issue please open new PR |
Convert regular strings with escape sequences to raw strings
(r'...') to fix SyntaxWarnings that appear with Python 3.14.
These warnings occur because escape sequences like
[, (, $, \d, \w are invalid in regular strings and will not work
in future Python versions.
Files modified:
commands with [, $, \x1b
All changes use raw strings (r'...') which treat backslashes literally,
making them suitable for regex patterns and shell commands.
The changes are backward compatible with older Python versions.
Signed-off-by: Sachin Sant sachinp@linux.ibm.com