feat(tools): Enforce utf-8 encoding with open() function

This commit is contained in:
Marek Fiala
2024-07-23 15:59:09 +02:00
parent ca961274f5
commit 2b0407eb2a
36 changed files with 117 additions and 137 deletions

View File

@@ -14,7 +14,7 @@ def test_spiffsgen_example(dut: Dut) -> None:
base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'spiffs_image')
# Expect hello.txt is read successfully
with open(os.path.join(base_dir, 'hello.txt'), 'r') as hello_txt:
with open(os.path.join(base_dir, 'hello.txt'), 'r', encoding='utf-8') as hello_txt:
dut.expect('Read from hello.txt: ' + hello_txt.read().rstrip())
# Expect alice.txt MD5 hash is computed accurately