diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-06-12 17:49:20 +0200 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2018-06-12 21:34:52 +0200 |
commit | 634bd970013eca90f4b4c1f9044eec8c97ba62c2 (patch) | |
tree | cf308babc695722ab55344bcd27b1b68802ce3f9 /contrib/linearize/linearize-data.py | |
parent | fa4b9065a8298f546d91fe382b4517fbf30749c1 (diff) |
Explicitly specify encoding when opening text files in Python code
Diffstat (limited to 'contrib/linearize/linearize-data.py')
-rwxr-xr-x | contrib/linearize/linearize-data.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index f8aea27342..b501388fd2 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -75,7 +75,7 @@ def get_blk_dt(blk_hdr): # When getting the list of block hashes, undo any byte reversals. def get_block_hashes(settings): blkindex = [] - f = open(settings['hashlist'], "r") + f = open(settings['hashlist'], "r", encoding="utf8") for line in f: line = line.rstrip() if settings['rev_hash_bytes'] == 'true': @@ -261,7 +261,7 @@ if __name__ == '__main__': print("Usage: linearize-data.py CONFIG-FILE") sys.exit(1) - f = open(sys.argv[1]) + f = open(sys.argv[1], encoding="utf8") for line in f: # skip comment lines m = re.search('^\s*#', line) |