diff --git a/crates/install-wheel-rs/src/wheel.rs b/crates/install-wheel-rs/src/wheel.rs index ee6ab1d5f584e..2ba0a0f2f0097 100644 --- a/crates/install-wheel-rs/src/wheel.rs +++ b/crates/install-wheel-rs/src/wheel.rs @@ -604,7 +604,8 @@ pub(crate) fn write_file_recorded( relative_path.display() ); - File::create(site_packages.join(relative_path))?.write_all(content.as_ref())?; + uv_fs::write_atomic_sync(site_packages.join(relative_path), content.as_ref())?; + let hash = Sha256::new().chain_update(content.as_ref()).finalize(); let encoded_hash = format!("sha256={}", BASE64URL_NOPAD.encode(&hash)); record.push(RecordEntry {