Skip to content

Commit f190514

Browse files
zaniebclaude
andauthored
Improve error handling for platform detection in Python downloads (#18453)
I noticed this weird error chain in #8635 (comment) ``` error: Failed to parse request part Caused by: Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls ``` Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3f03c64 commit f190514

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/uv-python/src/downloads.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,10 @@ impl PythonDownloadRequest {
405405
///
406406
/// Platform information is pulled from the environment.
407407
pub fn fill_platform(mut self) -> Result<Self, Error> {
408-
let platform = Platform::from_env()?;
408+
let platform = Platform::from_env().map_err(|err| match err {
409+
platform::Error::LibcDetectionError(err) => Error::LibcDetection(err),
410+
err => Error::InvalidRequestPlatform(err),
411+
})?;
409412
if self.arch.is_none() {
410413
self.arch = Some(ArchRequest::Environment(platform.arch));
411414
}

0 commit comments

Comments
 (0)