Skip to content

Autocomplete fails if stat errors, on nightly #56037

@asinghvi17

Description

@asinghvi17

My hard drive is slightly corrupted, and it looks like the new autocomplete on Nightly fails when it encounters an error in stat.

Since the files are corrupted, it's pretty hard to build a reproducer, but it's incredibly annoying because I basically can't type anything in the Pkg prompt.

I typed ] dev , key by key, and the error kicked me out of the Pkg prompt. Stacktrace is below.

(@v1.12) pkg> dev ┌ Error: Error in the keymap
│   exception =
│    IOError: stat("libspatialite_jll/"): Unknown system error -83 (Unknown system error -83)
│    Stacktrace:
│      [1] uv_error
│        @ ./libuv.jl:106 [inlined]
│      [2] checkstat
│        @ ./stat.jl:179 [inlined]
│      [3] stat(path::String)
│        @ Base.Filesystem ./stat.jl:185
│      [4] isdir
│        @ ./stat.jl:506 [inlined]
│      [5] (::REPLExt.var"#complete_expanded_local_dir##2#complete_expanded_local_dir##3"{String, Int64, UnitRange{Int64}})(x::String)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:42
│      [6] filter!(f::REPLExt.var"#complete_expanded_local_dir##2#complete_expanded_local_dir##3"{String, Int64, UnitRange{Int64}}, a::Vector{String})
│        @ Base ./array.jl:2927
│      [7] complete_expanded_local_dir(s::String, i1::Int64, i2::Int64, expanded_user::Bool, oldi2::Int64)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:40
│      [8] complete_local_dir(s::String, i1::Int64, i2::Int64)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:33
│      [9] complete_add_dev(options::Dict{Symbol, Any}, partial::String, i1::Int64, i2::Int64; hint::Bool)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:156
│     [10] complete_add_dev
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:155 [inlined]
│     [11] #41
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:207 [inlined]
│     [12] complete_argument(spec::Pkg.REPLMode.CommandSpec, options::Vector{String}, partial::String, offset::Int64, index::Int64; hint::Bool)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:221
│     [13] _completions(input::String, final::Bool, offset::Int64, index::Int64; hint::Bool)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:247
│     [14] _completions
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:224 [inlined]
│     [15] completions(full::String, index::Int64; hint::Bool)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:278
│     [16] completions
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/completions.jl:266 [inlined]
│     [17] complete_line(c::REPLExt.PkgCompletionProvider, s::REPL.LineEdit.PromptState; hint::Bool)
│        @ REPLExt ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/ext/REPLExt/REPLExt.jl:29
│     [18] complete_line(c::REPL.LineEdit.CompletionProvider, s::Any, ::Module; hint::Bool)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:188
│     [19] check_for_hint(s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:385
│     [20] (::REPL.LineEdit.var"#186#187")(s::REPL.LineEdit.MIState, data::Any, c::Union{Char, SubString{String}, String})
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2538
│     [21] #invokelatest#1
│        @ ./essentials.jl:1048 [inlined]
│     [22] invokelatest
│        @ ./essentials.jl:1045 [inlined]
│     [23] (::REPL.LineEdit.var"#match_input##0#match_input##1"{REPL.LineEdit.var"#186#187", String})(s::Any, p::Any)
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:1722
│     [24] macro expansion
│        @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2872 [inlined]
│     [25] macro expansion
│        @ ./lock.jl:287 [inlined]
│     [26] (::REPL.LineEdit.var"#prompt!##2#prompt!##3"{REPL.Terminals.TTYTerminal, REPL.LineEdit.ModalInterface, REPL.LineEdit.MIState, ReentrantLock, REPL.LineEdit.Prompt})()
│        @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2862
└ @ REPL.LineEdit ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:2874

Metadata

Metadata

Assignees

No one assigned

    Labels

    REPLJulia's REPL (Read Eval Print Loop)bugIndicates an unexpected problem or unintended behaviorcompletionsTab and autocompletion in the replfilesystemUnderlying file system and functions that use it

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions