-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
cd: <symlink target file>: Not a directory #1118
Comments
Haha 🤣 |
This corrects the deffect where pyenv tries to determine an absolute path of the directory containing a file and follows symlinks manually. Because of missing check it behaved correctly, but a misleading error message was shown in the terminal output. Thanks to @HQJaTu for the patch
Looks like there's a test for it and it's broken https://travis-ci.org/pyenv/pyenv/jobs/353851590#L523-L529 |
Okay.. test is not broken, but the fix is imperfect |
Got a solution: resolve |
Pipeline succeeds, dunno how to catch this with a test though. |
Ping @joshfriend @yyuu 🔔 |
Closing as duplicate of #580. |
File
pyenv
assumes, that it can follow symlinks inabs_dirname()
:However, the target file can be a symlink, and it cannot be followed.
Example from Ansible. Listing of
ansible/bin/
:Executing
~/ansible/bin/ansible-playbook
will work, but during it a~/.pyenv/libexec/pyenv: line 44: cd: ansible: Not a directory
is emitted.A suggested fix would be:
path="$(test -d "$name" && resolve_link "$name" || true)"
... to test if the destination is a directory that can be
cd
d into.If yes, follow that. If not, stop iterating without emitting errors.
The text was updated successfully, but these errors were encountered: