Skip to content

Commit a234daa

Browse files
guard against isdir EACESS in completions (#3877)
(cherry picked from commit 299b770)
1 parent f487626 commit a234daa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/REPLMode/completions.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@ function complete_expanded_local_dir(s, i1, i2, expanded_user, oldi2)
3737
cmp = REPL.REPLCompletions.complete_path(s, i2, shell_escape=true)
3838
cmp2 = cmp[2]
3939
completions = [REPL.REPLCompletions.completion_text(p) for p in cmp[1]]
40-
completions = filter!(x -> isdir(s[1:prevind(s, first(cmp2)-i1+1)]*x), completions)
40+
completions = filter!(completions) do x
41+
try
42+
isdir(s[1:prevind(s, first(cmp2)-i1+1)]*x)
43+
catch e
44+
if e isa Base.IOError && e.code == Base.UV_EACCES
45+
return false
46+
else
47+
rethrow()
48+
end
49+
end
50+
end
4151
if expanded_user
4252
if length(completions) == 1 && endswith(joinpath(homedir(), ""), first(completions))
4353
completions = [joinpath(s, "")]

0 commit comments

Comments
 (0)