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

Symlinks on Windows #177

Closed
pitdicker opened this issue Oct 14, 2016 · 3 comments
Closed

Symlinks on Windows #177

pitdicker opened this issue Oct 14, 2016 · 3 comments
Labels
question An issue that is lacking clarity on one or more points.

Comments

@pitdicker
Copy link

This is about the commit "Fix symlink test", which fails with access denied on Windows.

The standard library had the same problem, because Microsoft has made it very hard to create symlinks on Windows. I worked around it in this pull request.

The best option for testing is to use directory junctions, which you do have permission for to create.
But I never finished cleaning up the implementation of this in in the standard library...

@BurntSushi
Copy link
Owner

@pitdicker Thanks for reaching out. :-)

The best option for testing is to use directory junctions

Will this work for symlinking files? Some of the tests are already symlinking directories and that seems to work, but the test I killed was (I believe) trying to symlink a file.

@BurntSushi BurntSushi added the question An issue that is lacking clarity on one or more points. label Oct 14, 2016
@pitdicker
Copy link
Author

I am surprised to hear symlinking directories works, but don't have my computer nearby to check.
For files I have no solution.

The problem is that your Windows user account needs to have the SeCreateSymbolicLinkPrivilege. It is possible to grand this to a normal user account. For admin accounts the story is more complicated, because even if you have the permission, it is stripped during login in most cases. It is a bit unclear to me to be honest.

What I did was: create a normal user account on my computer with the permission to create symlinks, so I can run all the test locally. For all the tests that use symlinks, just do as if the test passes if creating the symlink fails. See the got_symlink_permission function and how it is used in the pull request I linked.

@BurntSushi
Copy link
Owner

I am going to close this. It's mildly annoying to skip a couple tests on Windows because of symlink issues, but I don't have the bandwidth to dig into fixing it properly.

If someone were especially motivated to fix this for real in a way that permits tests to pass on AppVeyor, then I'd support that effort, but otherwise I'm fine with what we have for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question An issue that is lacking clarity on one or more points.
Projects
None yet
Development

No branches or pull requests

2 participants