mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 10:19:26 +02:00
Explicitly specify encoding when opening text files in Python code
This commit is contained in:
@ -81,11 +81,11 @@ class GetblockstatsTest(BitcoinTestFramework):
|
||||
'mocktime': int(mocktime),
|
||||
'stats': self.expected_stats,
|
||||
}
|
||||
with open(filename, 'w') as f:
|
||||
with open(filename, 'w', encoding="utf8") as f:
|
||||
json.dump(to_dump, f, sort_keys=True, indent=2)
|
||||
|
||||
def load_test_data(self, filename):
|
||||
with open(filename, 'r') as f:
|
||||
with open(filename, 'r', encoding="utf8") as f:
|
||||
d = json.load(f)
|
||||
blocks = d['blocks']
|
||||
mocktime = d['mocktime']
|
||||
|
Reference in New Issue
Block a user