Closed gfrt0 closed 1 year ago
Hi @gfrt0 ,
I can reproduce this issue with julia 1.7.2 and the latest release of JLD2.
The issue is this (##meta#62
doc string container object, that can't be properly serialized / deserialized)
julia> f = jldopen("variables.jld2")
JLDFile /mnt/c/Users/Jonas Isensee/variables.jld2 (read-only)
├─🔢 ##meta#62
├─🔢 dict
├─🔢 str
├─🔢 tup
├─🔢 x
├─🔢 y
└─🔢 z
@save
without variables as arguments stores everything it finds in the main scope. This brings all kinds of problems with it which is also the reason that I've removed @save
and @load
from the docs. (e.g. silently deprecated so far)
I already tried to fix this once at some point in the past but the variable name seems to have changed: https://github.com/JuliaIO/JLD2.jl/blob/abb9e5920bbe956a4d9fd2f92550cd7ea0a715aa/src/loadsave.jl#L85
If you want, you could open a PR to make this line match more broadly.
Thank you @JonasIsensee, I noticed I could not find @save without arguments in the docs but did not think much of it. I can see how it can go wrong. I will find another way to list the large number of objects I want to save.
Code:
Error (\jldexample.jl:14 is the @load line; @save seems to work just fine):
Reinstalling JLD2 with
Pkg.build("JLD2")
and retrying yields a similar error, but a different unknown function:Apologies if this is a Julia problem and not a JLD2 problem. Given reinstalling returns a different error I suspect this may be a problem with my build.