From 6759e8012d2148974fbd0317c11c810896a5ab53 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 8 Oct 2024 20:53:24 +0200 Subject: [PATCH] Make open calls more uniform Text mode ('t') is the default for the open builtin, but not for gzip.open and its imitators. Always specify it explicitly to avoid making maintiners wonder if there's an intended difference in behavior. Signed-off-by: Gilles Peskine --- scripts/mbedtls_framework/outcome_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mbedtls_framework/outcome_analysis.py b/scripts/mbedtls_framework/outcome_analysis.py index 54aa57291..2a79fd57d 100644 --- a/scripts/mbedtls_framework/outcome_analysis.py +++ b/scripts/mbedtls_framework/outcome_analysis.py @@ -120,7 +120,7 @@ def open_outcome_file(outcome_file: str) -> typing.TextIO: elif outcome_file.endswith('.xz'): return lzma.open(outcome_file, 'rt', encoding='utf-8') else: - return open(outcome_file, 'r', encoding='utf-8') + return open(outcome_file, 'rt', encoding='utf-8') def read_outcome_file(outcome_file: str) -> Outcomes: """Parse an outcome file and return an outcome collection.