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

parsefile: Windows unlink permission denied #347

Open
AnHeuermann opened this issue Jul 29, 2022 · 0 comments
Open

parsefile: Windows unlink permission denied #347

AnHeuermann opened this issue Jul 29, 2022 · 0 comments

Comments

@AnHeuermann
Copy link

Description

On Windows I get an IOError when deleting a JSON file I previously parsed with JSON.parsefile.
Similar to #64 calling gc() solves the issue for me.

On Linux I have no such problems.

How to reproduce

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

Versions

  • JSON.jl: [682c06a0] JSON v0.21.3
  • Julia Version 1.7.1
    Commit ac5cc99908 (2021-12-22 19:35 UTC)
    Platform Info:
    OS: Windows (x86_64-w64-mingw32)
    CPU: Intel(R) Core(TM) i7-10700KF CPU @ 3.80GHz
    WORD_SIZE: 64
    LIBM: libopenlibm
    LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
    Environment:
    JULIA_CUDA_USE_BINARYBUILDER = false
    JULIA_EDITOR = code
    JULIA_NUM_THREADS =
  • OS: Windows 10
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

1 participant