Flush conda installer to disk before calculating sha

This commit is contained in:
YuviPanda
2021-10-19 15:07:44 +05:30
parent 9921403327
commit 63ced8eb7d

View File

@@ -51,6 +51,8 @@ def download_miniconda_installer(installer_url, sha256sum):
"""
with tempfile.NamedTemporaryFile('wb') as f:
f.write(requests.get(installer_url).content)
f.flush()
os.fsync()
if sha256_file(f.name) != sha256sum:
raise Exception('sha256sum hash mismatch! Downloaded file corrupted')