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

symlink throws wrong exception on Windows #40024

Closed
KristofferC opened this issue Mar 14, 2021 · 0 comments · Fixed by #40026
Closed

symlink throws wrong exception on Windows #40024

KristofferC opened this issue Mar 14, 2021 · 0 comments · Fixed by #40026
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version system:windows Affects only Windows
Milestone

Comments

@KristofferC
Copy link
Member

KristofferC commented Mar 14, 2021

MWE (on a non-admin Julia):

julia> touch("foo")
"foo"

julia> symlink("foo", "bar")
ERROR: MethodError: no method matching !(::Int64)
Closest candidates are:
  !(::Bool) at bool.jl:33
  !(::Function) at operators.jl:969
  !(::Missing) at missing.jl:101
Stacktrace:
 [1] symlink(target::String, link::String; dir_target::Bool)
   @ Base.Filesystem .\file.jl:1042
 [2] symlink(target::String, link::String)
   @ Base.Filesystem .\file.jl:1010
 [3] top-level scope
   @ REPL[20]:1

julia/base/file.jl

Lines 1056 to 1058 in cc45b99

if !(flags & UV_FS_SYMLINK_JUNCTION) && err == UV__EPERM
msg = "On Windows, creating symlinks requires Administrator privileges.\n$msg"
end

Introduced in #39491.

Tar.jl expects this to throw a IOError when it fails: https://github.com/JuliaIO/Tar.jl/blob/37766a22f5a6ac9f07022d83debd5db7d7a4b896/src/Tar.jl#L21-L33

Causes: #40000, #40022, #40021.

@KristofferC KristofferC added bug Indicates an unexpected problem or unintended behavior system:windows Affects only Windows regression Regression in behavior compared to a previous version labels Mar 14, 2021
@KristofferC KristofferC added this to the 1.6 blockers milestone Mar 14, 2021
@KristofferC KristofferC changed the title symlink function broken on Windows symlink throws wrong exception on Windows Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version system:windows Affects only Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant