Skip to content
Snippets Groups Projects
Commit cb7c4470 authored by Tooru Fujisawa's avatar Tooru Fujisawa
Browse files

Bug 1834673 - Part 1: Use UTF-8 in LCOV rewriter. r=firefox-build-system-reviewers,nalexander

parent 2c95334e
No related branches found
No related tags found
No related merge requests found
......@@ -235,7 +235,7 @@ class LcovFile(object):
current_pp_info = None
current_lines = []
for lcov_path in self.lcov_paths:
with open(lcov_path) as lcov_fh:
with open(lcov_path, "r", encoding="utf-8") as lcov_fh:
for line in lcov_fh:
line = line.rstrip()
if not line:
......@@ -433,7 +433,7 @@ class UrlFinder(object):
self._final_mapping = {}
try:
with open(chrome_map_path) as fh:
with open(chrome_map_path, "r", encoding="utf-8") as fh:
url_prefixes, overrides, install_info, buildconfig = json.load(fh)
except IOError:
print(
......@@ -692,14 +692,14 @@ class LcovFileRewriter(object):
if output_file:
lcov_file = LcovFile(in_paths)
with open(output_file, "w+") as out_fh:
with open(output_file, "w+", encoding="utf-8") as out_fh:
lcov_file.print_file(
out_fh, rewrite_source, self.pp_rewriter.rewrite_record
)
else:
for in_path in in_paths:
lcov_file = LcovFile([in_path])
with open(in_path + output_suffix, "w+") as out_fh:
with open(in_path + output_suffix, "w+", encoding="utf-8") as out_fh:
lcov_file.print_file(
out_fh, rewrite_source, self.pp_rewriter.rewrite_record
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment