mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 09:39:14 +08:00
MAINT: Make answer key reading compatible with Python 3.
Ensure reading of bytes and checking against byte type, when parsing the Excel spreadsheet which contains the answers.
This commit is contained in:
@@ -51,12 +51,12 @@ LATEST_ANSWER_KEY_URL = ANSWER_KEY_DL_TEMPLATE.format(
|
||||
|
||||
|
||||
def answer_key_signature():
|
||||
with open(ANSWER_KEY_PATH, 'r') as f:
|
||||
with open(ANSWER_KEY_PATH, 'rb') as f:
|
||||
md5 = hashlib.md5()
|
||||
while True:
|
||||
buf = f.read(1024)
|
||||
md5.update(buf)
|
||||
while buf != b"":
|
||||
buf = f.read(1024)
|
||||
if not buf:
|
||||
break
|
||||
md5.update(buf)
|
||||
return md5.hexdigest()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user