Open AnHeuermann opened 2 years ago
On Windows I get an IOError when deleting a JSON file I previously parsed with JSON.parsefile. Similar to https://github.com/JuliaIO/JSON.jl/pull/64 calling gc() solves the issue for me.
gc()
On Linux I have no such problems.
using JSON jsonFile = "test.json" open(jsonFile, "w") do io write(io, """ { "Hello": "World!" } """) end; infoFile = JSON.parsefile(jsonFile) #GC.gc() # <-- Solves issue rm(jsonFile) @info "Success"
ERROR: IOError: unlink("test.json"): permission denied (EACCES) Stacktrace: [1] uv_error @ .\libuv.jl:97 [inlined] [2] unlink(p::String) @ Base.Filesystem .\file.jl:958 [3] rm(path::String; force::Bool, recursive::Bool) @ Base.Filesystem .\file.jl:276 [4] rm(path::String) @ Base.Filesystem .\file.jl:267 [5] top-level scope @ path\to\bug.jl:17
Description
On Windows I get an IOError when deleting a JSON file I previously parsed with JSON.parsefile. Similar to https://github.com/JuliaIO/JSON.jl/pull/64 calling
gc()
solves the issue for me.On Linux I have no such problems.
How to reproduce
Versions
JULIA_EDITOR = code JULIA_NUM_THREADS =