Skip to contentSkip to conversation

tests: assume c source files are utf-8 encoded

PATCH Applied Robin Jarry 5 participants 5 messages Mar 5, 2024 – Mar 6, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: assume c source files are utf-8 encoded

Instead of relying on the default locale from the environment (LC_ALL), explicitly read the files as utf-8 encoded.

Fixes 0aeaf75df879 ("test: define unit tests suites based on test types")
---
 buildtools/get-test-suites.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
buildtools/get-test-suites.py +1 -1
index 574c233aa873..c61f6a273fad 100644
@@ -19,7 +19,7 @@ def get_fast_test_params(test_name, ln):
     return f":{nohuge.strip().lower()}:{asan.strip().lower()}"
 
 for fname in input_list:
-    with open(fname) as f:
+    with open(fname, "r", encoding="utf-8") as f:
         contents = [ln.strip() for ln in f.readlines()]
         test_lines = [ln for ln in contents if test_def_regex.match(ln)]
         non_suite_tests.extend([non_suite_regex.match(ln).group(1)
Signature · 1 line
2.44.0
#2 lore raw

05/03/2024 14:49, Bruce Richardson:

Quoted 11 lines · Robin Jarry
Quoted 7 lines

Instead of relying on the default locale from the environment (LC_ALL), explicitly read the files as utf-8 encoded.

Fixes 0aeaf75df879 ("test: define unit tests suites based on test types")

---

Thanks for the update/fix.

Applied, thanks.

Acked-by on v1 1/1
#3 lore raw
In reply to Robin Jarry
Quoted 10 lines

From: Robin Jarry [mailto:[email protected]]
Sent: Tuesday, 5 March 2024 14.46

Instead of relying on the default locale from the environment (LC_ALL), explicitly read the files as utf-8 encoded.

Fixes 0aeaf75df879 ("test: define unit tests suites based on test types")

---

I strongly agree on UTF-8 encoding everywhere in the DPDK project, so...