From 634bd970013eca90f4b4c1f9044eec8c97ba62c2 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 12 Jun 2018 17:49:20 +0200 Subject: Explicitly specify encoding when opening text files in Python code --- contrib/filter-lcov.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/filter-lcov.py') diff --git a/contrib/filter-lcov.py b/contrib/filter-lcov.py index 299377d691..df1db76e92 100755 --- a/contrib/filter-lcov.py +++ b/contrib/filter-lcov.py @@ -13,8 +13,8 @@ pattern = args.pattern outfile = args.outfile in_remove = False -with open(tracefile, 'r') as f: - with open(outfile, 'w') as wf: +with open(tracefile, 'r', encoding="utf8") as f: + with open(outfile, 'w', encoding="utf8") as wf: for line in f: for p in pattern: if line.startswith("SF:") and p in line: -- cgit v1.2.3