diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 3f59898c26381..7002c59d716e9 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -897,7 +897,11 @@ pub(crate) async fn run( .map(|entry| entry.path()) .filter(|path| is_executable(path)) .map(|path| { - if cfg!(windows) { + if cfg!(windows) + && path + .extension() + .is_some_and(|exe| exe == std::env::consts::EXE_EXTENSION) + { // Remove the extensions. path.with_extension("") } else { diff --git a/crates/uv/tests/it/run.rs b/crates/uv/tests/it/run.rs index 8a2a04fffa996..cf3b69915d6b2 100644 --- a/crates/uv/tests/it/run.rs +++ b/crates/uv/tests/it/run.rs @@ -248,7 +248,7 @@ fn run_no_args() -> Result<()> { The following commands are available in the environment: - - pydoc + - pydoc.bat - python - pythonw