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

This commit is contained in:
Marek Fiala
2024-07-23 15:59:09 +02:00
committed by BOT
parent 305f1c1e5b
commit 2c814ef2fa
40 changed files with 115 additions and 124 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