Explicitly specify encoding when opening text files in Python code

This commit is contained in:
practicalswift
2018-06-12 17:49:20 +02:00
parent fa4b9065a8
commit 634bd97001
19 changed files with 38 additions and 38 deletions

View File

@@ -44,7 +44,7 @@ def process_commands(fname):
"""Find and parse dispatch table in implementation file `fname`."""
cmds = []
in_rpcs = False
with open(fname, "r") as f:
with open(fname, "r", encoding="utf8") as f:
for line in f:
line = line.rstrip()
if not in_rpcs:
@@ -70,7 +70,7 @@ def process_mapping(fname):
"""Find and parse conversion table in implementation file `fname`."""
cmds = []
in_rpcs = False
with open(fname, "r") as f:
with open(fname, "r", encoding="utf8") as f:
for line in f:
line = line.rstrip()
if not in_rpcs: