diff options
| author | practicalswift <[email protected]> | 2018-06-12 17:49:20 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-06-12 21:34:52 +0200 |
| commit | 634bd970013eca90f4b4c1f9044eec8c97ba62c2 (patch) | |
| tree | cf308babc695722ab55344bcd27b1b68802ce3f9 /test/functional/rpc_getblockstats.py | |
| parent | Merge #13066: Migrate verify-commits script to python, run in travis (diff) | |
| download | discoin-634bd970013eca90f4b4c1f9044eec8c97ba62c2.tar.xz discoin-634bd970013eca90f4b4c1f9044eec8c97ba62c2.zip | |
Explicitly specify encoding when opening text files in Python code
Diffstat (limited to 'test/functional/rpc_getblockstats.py')
| -rwxr-xr-x | test/functional/rpc_getblockstats.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/rpc_getblockstats.py b/test/functional/rpc_getblockstats.py index 060a2373b..f573faaf1 100755 --- a/test/functional/rpc_getblockstats.py +++ b/test/functional/rpc_getblockstats.py @@ -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'] |