Skip to content

Commit d4e752b

Browse files
authored
Merge pull request #1598 from rstudio/fix-broken-link-warning
Ignore broken links encountered by `virtualenv_starter()`
2 parents 98df67a + 49ec37d commit d4e752b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# reticulate (development version)
22

3+
- `virtualenv_starter()` no longer warns when encountering broken symlinks (#1598).
4+
35
# reticulate 1.36.1
46

57
- Fix issue where `py_to_r()` method for Pandas DataFrames would error

R/virtualenv.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,10 @@ virtualenv_starter <- function(version = NULL, all = FALSE) {
533533
suffix)
534534
}
535535

536-
p <- unique(normalizePath(Sys.glob(glob), winslash = "/"))
536+
p <- unique(normalizePath(Sys.glob(glob), winslash = "/", mustWork = FALSE))
537537
p <- p[grep("^python[0-9.]*(\\.exe)?$", basename(p))]
538+
p <- p[utils::file_test("-x", p)]
539+
p <- p[utils::file_test("-f", p)]
538540
v <- numeric_version(vapply(p, function(python_path)
539541
tryCatch({
540542
v <- suppressWarnings(system2(

0 commit comments

Comments
 (0)