mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 18:02:44 +02:00
Explicitly specify encoding when opening text files in Python code
This commit is contained in:
@@ -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