JuliaIO / JLD.jl

Saving and loading julia variables while preserving native types
MIT License
278 stars 55 forks source link

error on Julia 1.7.0-beta2 #300

Closed PaulSoderlind closed 2 years ago

PaulSoderlind commented 3 years ago
using JLD
D = Dict("a"=>"Hazel")
save("test.jld","D",D)

gives


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

Fatal error:                                      
ERROR: LoadError: type DataType has no field mutable         
....```
mauro3 commented 3 years ago

T.mutable needs to be replaced with ismutabletype now. Similar to here https://github.com/mauro3/SimpleTraits.jl/pull/76/files

nandoconde commented 2 years ago

Has anyone taken action for this?

mauro3 commented 2 years ago

Unlikely, as there is no pull request. It looks like there is just one instance: https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L311, so it shouldn't be too hard (if that is indeed the only issue). But I just opened a PR in Compat.jl, then I think it should just be a using Compat.

nandoconde commented 2 years ago

I was about to make a PR changing it manually. It is present in some other places

jld_types.jl

https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L311 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L314 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L509 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L516 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L529 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/jld_types.jl#L539

JLD00.jl

https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/JLD00.jl#L475

JLD.jl

https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/JLD.jl#L461 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/JLD.jl#L471 https://github.com/JuliaIO/JLD.jl/blob/83ea0c5ef7293c78d7d9c8ffdf9ede599b54dc4c/src/JLD.jl#L696

Do you want to wait for Compat, or manually change it?

mauro3 commented 2 years ago

I have nothing to say here... but my take is that if it is just this one thing, then I wouldn't necessarily add the Compat.jl dependency.

nandoconde commented 2 years ago

Here it is #302

@timholy @simonster

jonbarkerlondon commented 2 years ago

Any movement on this?

I'm getting this error when loading a JLD in 1.7, wondering if it's related?

CapturedException(ErrorException("type DataType has no field mutable"), Any[(getproperty at Base.jl:37 [inlined], 1), (h5fieldtype(parent::JLD.JldFile, T::Any, commit::Bool) at jld_types.jl:313, 1)
musm commented 2 years ago

Fixed in https://github.com/JuliaIO/JLD.jl/pull/303 courtesy @mkitti

musm commented 2 years ago

I'm getting this error when loading a JLD in 1.7, wondering if it's related?

I've just made a new release with the latest fixes, please check now, should be fixed !