Skip to content

Commit d332bfd

Browse files
committed
Added encoding='utf-8' parameter to io.open operations in tests that starting failing since adding unicode_literals. Commit ready to merge
- Legacy-Id: 16562
1 parent c3ffd09 commit d332bfd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/doc/tests_charter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def test_submit_charter(self):
417417
self.assertEqual(charter.rev, next_revision(prev_rev))
418418
self.assertTrue("new_revision" in charter.latest_event().type)
419419

420-
with io.open(os.path.join(self.charter_dir, charter.canonical_name() + "-" + charter.rev + ".txt")) as f:
420+
with io.open(os.path.join(self.charter_dir, charter.canonical_name() + "-" + charter.rev + ".txt"), encoding='utf-8') as f:
421421
self.assertEqual(f.read(), "Windows line\nMac line\nUnix line\n" + utf_8_snippet.decode('utf-8'))
422422

423423
def test_submit_initial_charter(self):

ietf/utils/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def report(self):
267267
analysis = self.coverage._analyze(fr)
268268
nums = analysis.numbers
269269
missing_nums = sorted(analysis.missing)
270-
with io.open(analysis.filename) as file:
270+
with io.open(analysis.filename, encoding='utf-8') as file:
271271
lines = file.read().splitlines()
272272
missing_lines = [ lines[l-1] for l in missing_nums ]
273273
result["covered"][fr.relative_filename()] = (nums.n_statements, nums.pc_covered/100.0, missing_nums, missing_lines)

0 commit comments

Comments
 (0)