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

Fix the treatment of broken symlink #7

Merged
merged 1 commit into from Nov 17, 2016
Merged

Conversation

shippy
Copy link
Contributor

@shippy shippy commented Nov 17, 2016

os.path.exists(f) and os.path.isfile(f) return False when the f
is a broken symlink. This causes dotty to skip the entire existing-file
logic and try to link an existing file, resulting in FileExistsError: [Errno 17]. Even if the logic was used, dotty attempts to remove the
broken symlink as directory, because os.path.isfile(f) says it's not
a file.

Using os.path.lexists and determining whether the symlink is broken
fixes the problem.

`os.path.exists(f)` and `os.path.isfile(f)` return `False` when the `f`
is a broken symlink. This causes dotty to skip the entire existing-file
logic and try to link an existing file, resulting in `FileExistsError:
[Errno 17]`. Even if the logic was used, dotty attempts to remove the
broken symlink as directory, because `os.path.isfile(f)` says it's not
a file.

Using `os.path.lexists` and determining whether the symlink is broken
fixes the problem.
@vibhavp vibhavp merged commit 8fc1eab into vibhavp:master Nov 17, 2016
@vibhavp
Copy link
Owner

vibhavp commented Nov 17, 2016

thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants