mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-24 13:43:45 +00:00
Avoid returning zipped wheels from registry and URL indexes (#558)
## Summary This is hard to reproduce, but if you run a long installation process that errors part-way through, you can end up with zipped wheels in the `Wheels` cache, which is intended to contain only unzipped wheels. This PR avoids returning those entries from the registry, which will then lead to errors downstream when we treat them as directories.
This commit is contained in:
parent
2d1e19e474
commit
f99e3560e8
3 changed files with 11 additions and 7 deletions
|
@ -103,7 +103,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
|||
}
|
||||
}
|
||||
|
||||
/// In parallel, either fetch the wheel or fetch and built source distributions.
|
||||
/// In parallel, either fetch each wheel or build each source distribution.
|
||||
pub async fn get_wheels(
|
||||
&self,
|
||||
dists: Vec<Dist>,
|
||||
|
@ -191,7 +191,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
|||
small_size.map_or("unknown size".to_string(), |size| size.to_string());
|
||||
debug!("Fetching disk-based wheel from registry: {dist} ({size})");
|
||||
|
||||
// Download the wheel to a temporary file.
|
||||
// Download the wheel into the cache.
|
||||
fs::create_dir_all(&cache_entry.dir).await?;
|
||||
let mut writer = fs::File::create(cache_entry.path()).await?;
|
||||
tokio::io::copy(&mut reader.compat(), &mut writer).await?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue