python: Explicitly specify the encoding when opening files

This commit is contained in:
Eduardo Almeida
2023-05-21 17:31:39 +01:00
parent b20c657523
commit 20ae6fb2d0
12 changed files with 57 additions and 57 deletions

View File

@@ -121,9 +121,9 @@ class TestBaseClass:
passed = 0
progress = 0.0
failed_cases = []
with open(self.options.out_file, 'w') as out:
with open(self.options.out_file, 'w', encoding='utf-8') as out:
outstream = out
with open(os.devnull, 'w') as sink:
with open(os.devnull, 'w', encoding='utf-8') as sink:
if self.options.mute:
outstream = sink
for cmd in cmds: