BUG: Make write of binary file compatible with Python 3.

Open the destination file with the byte flag to avoid error in
Python 3 with mismatch of str and byte.
This commit is contained in:
Eddie Hebert
2014-01-07 18:01:25 -05:00
parent 71cda461c5
commit c53196b5ea
+1 -1
View File
@@ -109,7 +109,7 @@ def ensure_latest_answer_key():
if answer_key_dl_checksum:
res = requests.get(
ANSWER_KEY_DL_TEMPLATE.format(md5=answer_key_dl_checksum))
with open(ANSWER_KEY_PATH, 'w') as f:
with open(ANSWER_KEY_PATH, 'wb') as f:
f.write(res.content)
# Get latest answer key on load.