Skip to content

Commit d2df753

Browse files
authored
Ignore empty paths in windows registry search (#156)
Fixes #149
1 parent 8a79c63 commit d2df753

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.devcontainer/linux-x64/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amd64/ubuntu
1+
FROM amd64/ubuntu:24.04
22

33
# Setup Python
44
RUN apt-get update && \

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
134134
run: |
135135
pyenv install --list
136-
pyenv install 3.12.5 3.8.19
136+
pyenv install 3.12.6 3.8.19
137137
shell: bash
138138

139139
# pyenv-win install list has not updated for a while

crates/pet-windows-registry/src/environments.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ fn get_registry_pythons_from_key_for_company(
101101
Ok(install_path_key) => {
102102
let env_path: String =
103103
install_path_key.get_value("").ok().unwrap_or_default();
104+
if env_path.is_empty() {
105+
warn!(
106+
"Install path is empty {}\\Software\\Python\\{}\\{}",
107+
key_container, company, installed_python
108+
);
109+
continue;
110+
}
104111
let env_path = norm_case(PathBuf::from(env_path));
105112
if is_windows_app_folder_in_program_files(&env_path) {
106113
trace!(

crates/pet/tests/ci_homebrew_container.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn verify_python_in_homebrew_contaner() {
5050
let python3_12 = PythonEnvironment {
5151
kind: Some(PythonEnvironmentKind::Homebrew),
5252
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3")),
53-
version: Some("3.12.5".to_string()), // This can change on CI, so we don't check it
53+
version: Some("3.12.6".to_string()), // This can change on CI, so we don't check it
5454
symlinks: Some(vec![
5555
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3"),
5656
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.12"),
@@ -61,19 +61,19 @@ fn verify_python_in_homebrew_contaner() {
6161
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/[email protected]/bin/python3"),
6262
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/[email protected]/bin/python3.12"),
6363
// On CI the Python version can change with minor updates, so we don't check the full version.
64-
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.12.5/bin/python3.12"),
64+
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.12.6/bin/python3.12"),
6565
]),
6666
..Default::default()
6767
};
6868
let python3_11 = PythonEnvironment {
6969
kind: Some(PythonEnvironmentKind::Homebrew),
7070
executable: Some(PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11")),
71-
version: Some("3.11.9".to_string()), // This can change on CI, so we don't check it
71+
version: Some("3.11.10".to_string()), // This can change on CI, so we don't check it
7272
symlinks: Some(vec![
7373
PathBuf::from("/home/linuxbrew/.linuxbrew/bin/python3.11"),
7474
PathBuf::from("/home/linuxbrew/.linuxbrew/opt/[email protected]/bin/python3.11"),
7575
// On CI the Python version can change with minor updates, so we don't check the full version.
76-
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.11.9/bin/python3.11"),
76+
// PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.11.10/bin/python3.11"),
7777
]),
7878
..Default::default()
7979
};

0 commit comments

Comments
 (0)