Explicitly specify encoding when opening text files in Python code

This commit is contained in:
practicalswift committed 2018-06-12 21:34:52 +02:00
1 parent fa4b9065a8
commit 634bd97001
19 files changed
+38 -38

No files matched your search

+2 -2
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: