From 76d8c19d2dda30faee41c62d7ad7622385ac5778 Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sat, 20 May 2023 13:32:03 +0100 Subject: [PATCH] atomic downloads --- src/poetry/utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/poetry/utils/helpers.py b/src/poetry/utils/helpers.py index b39e8230e10..ab2f369aa6e 100644 --- a/src/poetry/utils/helpers.py +++ b/src/poetry/utils/helpers.py @@ -121,7 +121,7 @@ def download_file( # but skip the updating set_indicator = total_size > 1024 * 1024 - with dest.open("wb") as f: + with atomic_open(dest) as f: for chunk in response.iter_content(chunk_size=chunk_size): if chunk: f.write(chunk)