audk/BaseTools/Source/Python
Mike Beaton 6820004b3e BaseTools: Fix multiple 'invalid escape sequence' warnings in tests
In Python 3.12 invalid escape sequences in strings moved from
DeprecationWarning to SyntaxWarning
(ref https://docs.python.org/3/whatsnew/changelog.html#python-3-12-0-final
and search for gh-98401). In a future Python version this will become
SyntaxError.

Multiple instances of these SyntaxWarnings are currently printed when
running the BaseTools tests using Python 3.12 (though without actually
failing the affected tests).

This commit updates all lines which were causing this type of warning.

Typical examples which needed fixing are:

- "BaseTools\Source\Python" representing a path: "\S" and "\P" are invalid
escape sequences, therefore left unchanged, therefore the test works
(with a warning in Python 3.12). r"BaseTools\Source\Python" represents
the same string, but with escapes turned off completely thus no warning.

- Where '\t\s' is used as a regex pattern, then chr(9) + '\\s' is sent
to the regex parser (with a warning in Python 3.12) since '\s' is not a
valid Python escape sequence. This works correctly, though arguably for
the wrong reasons. r'\t\s' sends the same as '\\t\\s', as originally
intended and with no warning.

(Note that ' and " are not fundamentally different in Python.)

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-09-23 04:55:53 +00:00
..
AmlToC BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
AutoGen BaseTools: Update Stack Cookie Logic 2024-09-13 03:58:46 +00:00
BPDG BaseTools: Fix various typos 2019-07-08 08:59:29 +08:00
Capsule BaseTools/Capsule: Support Different Hash Algorithm for Payload Digest 2024-08-05 05:49:16 +00:00
Common BaseTools: Update Stack Cookie Logic 2024-09-13 03:58:46 +00:00
CommonDataClass BaseTools: Add support for SUBTYPE_GUID section generation 2022-10-19 06:32:07 +00:00
Ecc BaseTools: Fix multiple 'invalid escape sequence' warnings in tests 2024-09-23 04:55:53 +00:00
Eot BaseTools: Fix multiple 'invalid escape sequence' warnings in tests 2024-09-23 04:55:53 +00:00
FMMT BaseTools/Fmmt.py: Python 3.12 support 2024-04-23 21:36:22 +00:00
FirmwareStorageFormat BaseTools: FMMT support ELF UPLD parser 2023-12-11 10:12:52 +00:00
GenFds BaseTools: Use Stronger Matching for NULL Linked Libraries 2024-04-15 19:04:08 +00:00
GenPatchPcdTable BaseTools: Resolve regex syntax warnings 2023-12-21 00:33:31 +00:00
PatchPcdValue BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
Pkcs7Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Rsa2048Sha256Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Split BaseTools: use shutil.copyfile instead shutil.copy2 2021-08-02 03:52:15 +00:00
Table
TargetTool BaseTools: Remove hard-coded strings for target and tools_def 2021-09-29 14:31:37 +00:00
Trim BaseTools: Trim: Add header/footer for ASL include 2024-08-31 04:58:54 +00:00
UPT BaseTools: Fix multiple 'invalid escape sequence' warnings in tests 2024-09-23 04:55:53 +00:00
Workspace BaseTools: InfBuildData: Fix Private value retrieval 2024-07-04 11:55:25 +00:00
build BaseTools: Update Stack Cookie Logic 2024-09-13 03:58:46 +00:00
tests/Split BaseTools: fix the split output files root dir 2021-02-07 01:46:18 +00:00
GNUmakefile
Makefile BaseTools: strip trailing whitespace 2019-10-04 11:18:22 +01:00
basetool_tiano_python_path_env.yaml BaseTools: Add YAML files with path env and tool extdeps 2019-11-11 13:01:53 -08:00
sitecustomize.py BaseTools: Do not call sys.setdefaultencoding with python 3 2019-10-23 14:25:23 +08:00