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 <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2024-10-08 20:53:24 +02:00
parent d63709d3db
commit 6759e8012d
@@ -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.