From 97ae811b862c7abc4477b2fdd1a4ab76545cd0e9 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 18 Sep 2024 09:33:11 -0400 Subject: [PATCH] Avoid fatal error when searching for egg-info with missing directory (#7498) ## Summary Closes https://github.com/astral-sh/uv/issues/7485. ## Test Plan ``` $ cargo run cache clean $ cargo run venv $ cargo run pip install django-allauth==0.51.0 $ cargo run venv $ cargo run pip install django-allauth==0.51.0 ``` --- crates/uv-distribution/src/source/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/uv-distribution/src/source/mod.rs b/crates/uv-distribution/src/source/mod.rs index bb49fb2e9..9bcf1a7d2 100644 --- a/crates/uv-distribution/src/source/mod.rs +++ b/crates/uv-distribution/src/source/mod.rs @@ -1899,6 +1899,9 @@ async fn read_egg_info( let egg_info = match find_egg_info(directory.as_ref()) { Ok(Some(path)) => path, Ok(None) => return Err(Error::MissingEggInfo), + Err(err) if err.kind() == std::io::ErrorKind::NotFound => { + return Err(Error::MissingEggInfo) + } Err(err) => return Err(Error::CacheRead(err)), };