Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RData can't load .rda files with FileIO@1.10.0 but can with FileIO@1.9.0 #89

Closed
jonasjonker opened this issue Jun 21, 2021 · 3 comments
Closed

Comments

@jonasjonker
Copy link

FileIO@1.10.0 causes RData to throw a load error which can be solved by downgrading to FileIO@1.9.0.

 pkg> status
      Status `~/Repos/juliaplotting/Project.toml`
  [5789e2e9] FileIO v1.10.0
  [91a5bcdd] Plots v1.16.5
  [c3e4b0f8] Pluto v0.14.8
  [ce6b1742] RDatasets v0.7.5
julia> using RDatasets
julia> iris = dataset("datasets", "iris")
Error encountered while load FileIO.File{FileIO.DataFormat{:RData}, String}("/home/jonas/.julia/packages/RDatasets/eRbZP/src/../data/datasets/iris.rda").

Fatal error:
ERROR: RData load error: neither load nor fileio_load is defined
  due to MethodError(seek, (TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream}(<mode=close>), 0), 0x00000000000073cb)
  Will try next loader.

Stacktrace:
  [1] getlength(io::TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream}, pos::Int64)
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/query.jl:62
  [2] getlength(io::TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/query.jl:60
  [3] detect_rdata(io::TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/registry.jl:62
  [4] fileio_load(s::FileIO.Stream{FileIO.DataFormat{:RData}, TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream}, String}; kwoptions::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ RData ~/.julia/packages/RData/Re6gn/src/RData.jl:53
  [5] fileio_load(s::FileIO.Stream{FileIO.DataFormat{:RData}, TranscodingStreams.TranscodingStream{CodecZlib.GzipDecompressor, IOStream}, String})
    @ RData ~/.julia/packages/RData/Re6gn/src/RData.jl:52
  [6] fileio_load(f::FileIO.File{FileIO.DataFormat{:RData}, String}; kwoptions::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ RData ~/.julia/packages/RData/Re6gn/src/RData.jl:95
  [7] fileio_load(f::FileIO.File{FileIO.DataFormat{:RData}, String})
    @ RData ~/.julia/packages/RData/Re6gn/src/RData.jl:92
  [8] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
  [9] invokelatest
    @ ./essentials.jl:706 [inlined]
 [10] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:217
 [11] action
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:197 [inlined]
 [12] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:185
 [13] action
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:185 [inlined]
 [14] load(::String; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:113
 [15] load
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:110 [inlined]
 [16] dataset(package_name::String, dataset_name::String)
    @ RDatasets ~/.julia/packages/RDatasets/eRbZP/src/dataset.jl:12
 [17] top-level scope
    @ REPL[2]:1
 [18] eval
    @ ./boot.jl:360 [inlined]
 [19] eval_user_input(ast::Any, backend::REPL.REPLBackend)
    @ REPL /opt/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:139
 [20] repl_backend_loop(backend::REPL.REPLBackend)
    @ REPL /opt/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:200
 [21] start_repl_backend(backend::REPL.REPLBackend, consumer::Any)
    @ REPL /opt/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:185
 [22] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool)
    @ REPL /opt/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:317
 [23] run_repl(repl::REPL.AbstractREPL, consumer::Any)
    @ REPL /opt/julia/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:305
 [24] (::Base.var"#874#876"{Bool, Bool, Bool})(REPL::Module)
    @ Base ./client.jl:387
 [25] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [26] invokelatest
    @ ./essentials.jl:706 [inlined]
 [27] run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool)
    @ Base ./client.jl:372
 [28] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:302
 [29] _start()
    @ Base ./client.jl:485
Stacktrace:
  [1] handle_error(e::FileIO.LoaderError, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/error_handling.jl:61
  [2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector{T} where T}}, action::String)
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/error_handling.jl:56
  [3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:226
  [4] action
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:197 [inlined]
  [5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:185
  [6] action
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:185 [inlined]
  [7] load(::String; options::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ FileIO ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:113
  [8] load
    @ ~/.julia/packages/FileIO/LoVdY/src/loadsave.jl:110 [inlined]
  [9] dataset(package_name::String, dataset_name::String)
    @ RDatasets ~/.julia/packages/RDatasets/eRbZP/src/dataset.jl:12
 [10] top-level scope
    @ REPL[2]:1
 pkg> add FileIO@1.9.0
... 

julia> iris = dataset("datasets", "iris")
150×5 DataFrame
 Row │ SepalLength  SepalWidth  PetalLength  PetalWidth  Species   
     │ Float64      Float64     Float64      Float64     Cat      
─────┼─────────────────────────────────────────────────────────────
   15.1         3.5          1.4         0.2  setosa
   24.9         3.0          1.4         0.2  setosa
                                               
 1496.2         3.4          5.4         2.3  virginica
 1505.9         3.0          5.1         1.8  virginica
                                                   146 rows omitted
@alyst
Copy link
Collaborator

alyst commented Jun 21, 2021

Thanks for reporting! I can reproduce it with ]test RData.
To me it looks like the issue could be caused by the changes in package loading logic in FileIO 1.10, in particular related to this commit.
Could you please submit a bug report there (referencing this issue)?

@jonasjonker
Copy link
Author

Yes I can. You can find it here.

@alyst
Copy link
Collaborator

alyst commented Jun 21, 2021

fixed upstream (FileIO v1.10.1)

@alyst alyst closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants