From a8e2cd3ddd76cc61328c4947e00ebdee0f884317 Mon Sep 17 00:00:00 2001 From: William Lyu Date: Wed, 25 Feb 2015 10:10:34 +0800 Subject: [PATCH] fix a bug bug with VERIFY MD5 CHECKSUMS Datas should be opened with option 'rb' otherwise it will cause a decode problem. --- data/get_nndc_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/get_nndc_data.py b/data/get_nndc_data.py index b888073fc..5df69f3ac 100755 --- a/data/get_nndc_data.py +++ b/data/get_nndc_data.py @@ -79,7 +79,7 @@ for f in files: print('Verifying MD5 checksums...') for f, checksum in zip(files, checksums): - downloadsum = hashlib.md5(open(f, 'r').read()).hexdigest() + downloadsum = hashlib.md5(open(f, 'rb').read()).hexdigest() if downloadsum != checksum: raise IOError("MD5 checksum for {} does not match. If this is your first " "time receiving this message, please re-run the script. "