From 63ced8eb7dbb9c1eda247d9f48bca3c1351d3e2a Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Tue, 19 Oct 2021 15:07:44 +0530 Subject: [PATCH] Flush conda installer to disk before calculating sha --- tljh/conda.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tljh/conda.py b/tljh/conda.py index ee8568c..558c218 100644 --- a/tljh/conda.py +++ b/tljh/conda.py @@ -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')