improve Python environment activation (#118)

This commit is contained in:
Josh Thomas 2025-04-30 12:34:20 -05:00 committed by GitHub
parent 3b7ffe0b70
commit c09d6541ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 669 additions and 290 deletions

View file

@ -29,13 +29,12 @@ fn uri_to_pathbuf(uri: &Uri) -> Option<PathBuf> {
// Decode the percent-encoded path string
let decoded_path_cow = percent_decode_str(encoded_path_str).decode_utf8_lossy();
let path_str = decoded_path_cow.as_ref();
#[cfg(unix)]
let path_str = decoded_path_cow.as_ref();
#[cfg(windows)]
let path_str = {
// Remove leading '/' for paths like /C:/...
path_str.strip_prefix('/').unwrap_or(path_str)
};
// Remove leading '/' for paths like /C:/...
let path_str = path_str.strip_prefix('/').unwrap_or(path_str);
Some(PathBuf::from(path_str))
}