Explicitly specify encoding when opening text files in Python code
This commit is contained in:
1 parent
fa4b9065a8
commit
634bd97001
19 files changed
+38
-38
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user