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/feature_notifications.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/feature_notifications.py')
| -rwxr-xr-x | test/functional/feature_notifications.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/functional/feature_notifications.py b/test/functional/feature_notifications.py index 8964c8d64..6d51f31e3 100755 --- a/test/functional/feature_notifications.py +++ b/test/functional/feature_notifications.py @@ -36,7 +36,7 @@ class NotificationsTest(BitcoinTestFramework): wait_until(lambda: os.path.isfile(self.block_filename) and os.stat(self.block_filename).st_size >= (block_count * 65), timeout=10) # file content should equal the generated blocks hashes - with open(self.block_filename, 'r') as f: + with open(self.block_filename, 'r', encoding="utf-8") as f: assert_equal(sorted(blocks), sorted(l.strip() for l in f.read().splitlines())) self.log.info("test -walletnotify") @@ -45,7 +45,7 @@ class NotificationsTest(BitcoinTestFramework): # file content should equal the generated transaction hashes txids_rpc = list(map(lambda t: t['txid'], self.nodes[1].listtransactions("*", block_count))) - with open(self.tx_filename, 'r') as f: + with open(self.tx_filename, 'r', encoding="ascii") as f: assert_equal(sorted(txids_rpc), sorted(l.strip() for l in f.read().splitlines())) os.remove(self.tx_filename) @@ -58,7 +58,7 @@ class NotificationsTest(BitcoinTestFramework): # file content should equal the generated transaction hashes txids_rpc = list(map(lambda t: t['txid'], self.nodes[1].listtransactions("*", block_count))) - with open(self.tx_filename, 'r') as f: + with open(self.tx_filename, 'r', encoding="ascii") as f: assert_equal(sorted(txids_rpc), sorted(l.strip() for l in f.read().splitlines())) # Mine another 41 up-version blocks. -alertnotify should trigger on the 51st. |