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)