From 574aa1ef110ef08293512eb200bd6881bb738179 Mon Sep 17 00:00:00 2001 From: konsti Date: Fri, 18 Jul 2025 15:26:47 +0200 Subject: [PATCH] Better error reporting for removing Python versions from the Windows registry (#14722) See https://github.com/astral-sh/uv/actions/runs/16370666070/job/46258004849 We didn't actual use a format string, showing the template instead. We don't show the causes in the error report, so we format it into one error. --- crates/uv-python/src/windows_registry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv-python/src/windows_registry.rs b/crates/uv-python/src/windows_registry.rs index f722db60c..0020f95e9 100644 --- a/crates/uv-python/src/windows_registry.rs +++ b/crates/uv-python/src/windows_registry.rs @@ -3,6 +3,7 @@ use crate::managed::ManagedPythonInstallation; use crate::platform::Arch; use crate::{COMPANY_DISPLAY_NAME, COMPANY_KEY, PythonInstallationKey, PythonVersion}; +use anyhow::anyhow; use std::cmp::Ordering; use std::collections::HashSet; use std::path::PathBuf; @@ -238,8 +239,7 @@ pub fn remove_registry_entry<'a>( } else { errors.push(( installation.key().clone(), - anyhow::Error::new(err) - .context("Failed to clear registry entries under HKCU:\\{python_entry}"), + anyhow!("Failed to clear registry entries under HKCU:\\{python_entry}: {err}"), )); } }