From 96b28f0eaa158bb1e37dde9186d1520f17fd76ee Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 18 Jul 2025 07:19:15 -0500 Subject: [PATCH] Ignore "not found" errors when removing orphaned registry keys --- crates/uv-python/src/windows_registry.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/uv-python/src/windows_registry.rs b/crates/uv-python/src/windows_registry.rs index 7c6f6f307..764ba96a3 100644 --- a/crates/uv-python/src/windows_registry.rs +++ b/crates/uv-python/src/windows_registry.rs @@ -282,7 +282,11 @@ pub fn remove_orphan_registry_entries(installations: &[ManagedPythonInstallation debug!("Removing orphan registry key HKCU:\\{}", python_entry); if let Err(err) = CURRENT_USER.remove_tree(&python_entry) { // TODO(konsti): We don't have an installation key here. - warn_user_once!("Failed to remove orphan registry key HKCU:\\{python_entry}: {err}"); + if err.code() != ERROR_NOT_FOUND { + warn_user_once!( + "Failed to remove orphan registry key HKCU:\\{python_entry}: {err}" + ); + } } } }