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

Storing/loading StepRangeLen fails #321

Open
denis-ko opened this issue Dec 16, 2022 · 2 comments
Open

Storing/loading StepRangeLen fails #321

denis-ko opened this issue Dec 16, 2022 · 2 comments

Comments

@denis-ko
Copy link

denis-ko commented Dec 16, 2022

The following code generates an error:

jldopen("test.jld", "w") do f
        write(f, "x", 1:0.1:2)
end

jldopen("test.jld", "r+") do f
    write(f, "y", 1:0.1:2)
end

load("test.jld")

Error: Error encountered while load FileIO.File{FileIO.DataFormat{:JLD}, String}("test.jld").

Fatal error:
ERROR: stored type Base.StepRangeLen{Core.Float64,Base.TwicePrecision{Core.Float64},Base.TwicePrecision{Core.Float64},Core.Int64} does not match currently loaded type

@mkitti
Copy link
Member

mkitti commented Dec 19, 2022

Can you provide a longer error trace? Thanks

@denis-ko
Copy link
Author

denis-ko commented Dec 19, 2022

julia> load("test.jld")
Error encountered while load FileIO.File{FileIO.DataFormat{:JLD}, String}("test.jld").

Fatal error:
ERROR: stored type Base.StepRangeLen{Core.Float64,Base.TwicePrecision{Core.Float64},Base.TwicePrecision{Core.Float64},Core.Int64} does not match currently loaded type
Stacktrace:
[1] jldatatype(parent::JLD.JldFile, dtype::HDF5.Datatype)
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\jld_types.jl:735
[2] read(obj::JLD.JldDataset)
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:386
[3] read(parent::JLD.JldFile, name::String)
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:362
[4] #45
@ .\array.jl:0 [inlined]
[5] iterate
@ .\generator.jl:47 [inlined]
[6] collect_to!(dest::Vector{Tuple{String, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, itr::Base.Generator{Vector{String}, JLD.var"#45#47"{JLD.JldFile}}, offs::Int64, st::Int64)
@ Base .\array.jl:845
[7] collect_to_with_first!(dest::Vector{Tuple{String, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}, v1::Tuple{String, StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}, itr::Base.Generator{Vector{String}, JLD.var"#45#47"{JLD.JldFile}}, st::Int64)
@ Base .\array.jl:823
[8] collect(itr::Base.Generator{Vector{String}, JLD.var"#45#47"{JLD.JldFile}})
@ Base .\array.jl:797
[9] (::JLD.var"#44#46")(file::JLD.JldFile)
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:1273
[10] jldopen(::JLD.var"#44#46", ::String, ::Vararg{String}; kws::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:262
[11] jldopen
@ C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:259 [inlined]
[12] fileio_load(f::FileIO.File{FileIO.DataFormat{:JLD}, String})
@ JLD C:\Users\denis.julia\packages\JLD\6OyJe\src\JLD.jl:1272
[13] #invokelatest#2
@ .\essentials.jl:729 [inlined]
[14] invokelatest
@ .\essentials.jl:726 [inlined]
[15] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:219
[16] action
@ C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:196 [inlined]
[17] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:185
[18] action
@ C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:185 [inlined]
[19] load(::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:113
[20] load(::String)
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:109
[21] top-level scope
@ REPL[18]:1
Stacktrace:
[1] handle_error(e::JLD.TypeMismatchException, q::Base.PkgId, bt::Vector{Union{Ptr{Nothing}, Base.InterpreterIP}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\error_handling.jl:61
[2] handle_exceptions(exceptions::Vector{Tuple{Any, Union{Base.PkgId, Module}, Vector}}, action::String)
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\error_handling.jl:56
[3] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::FileIO.Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:228
[4] action
@ C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:196 [inlined]
[5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Symbol, ::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:185
[6] action
@ C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:185 [inlined]
[7] load(::String; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:113
[8] load(::String)
@ FileIO C:\Users\denis.julia\packages\FileIO\aP78L\src\loadsave.jl:109
[9] top-level scope
@ REPL[18]:1

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