From badf7502827bc8f77cb4c572e5186584deea7a89 Mon Sep 17 00:00:00 2001 From: Francesco Valla Date: Sun, 31 May 2026 17:24:23 +0200 Subject: dtoc: test: add missing escape in help text A single percent sign might be interpreted as a string format directive and shall thus be escaped - doubling it - to actually indicate a percentage. Without the escape, pytest fails to run test_fdt.py with the following error: ValueError: Test coverage failure fdt code coverage: Traceback (most recent call last): File "/usr/lib64/python3.14/argparse.py", line 1748, in _check_help formatter._expand_help(action) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ File "/usr/lib64/python3.14/argparse.py", line 676, in _expand_help return help_string % params ~~~~~~~~~~~~^~~~~~~~ TypeError: %c requires an int or a unicode character, not dict The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/user/u-boot/./tools/dtoc/test_fdt", line 1002, in sys.exit(main()) ~~~~^^ File "/home/user/u-boot/./tools/dtoc/test_fdt", line 987, in main parser.add_argument('-T', '--test-coverage', action='store_true', ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ default=False, ^^^^^^^^^^^^^^ help='run tests and check for 100% coverage') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.14/argparse.py", line 1562, in add_argument self._check_help(action) ~~~~~~~~~~~~~~~~^^^^^^^^ File "/usr/lib64/python3.14/argparse.py", line 1750, in _check_help raise ValueError('badly formed help string') from exc ValueError: badly formed help string Fixes: 7640b166604e ("test_fdt: Convert to use argparse") Signed-off-by: Francesco Valla --- tools/dtoc/test_fdt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index a0bed4e18bb..f141f931a94 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -986,7 +986,7 @@ def main(): default=False, help='run tests') parser.add_argument('-T', '--test-coverage', action='store_true', default=False, - help='run tests and check for 100% coverage') + help='run tests and check for 100%% coverage') parser.add_argument('name', nargs='*') args = parser.parse_args() -- cgit v1.3.1