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

LocalFileSystem.isdir inconsistent with os.path.isdir with symbolic links #591

Closed
ethanwharris opened this issue Apr 1, 2021 · 1 comment · Fixed by #608
Closed

LocalFileSystem.isdir inconsistent with os.path.isdir with symbolic links #591

ethanwharris opened this issue Apr 1, 2021 · 1 comment · Fixed by #608

Comments

@ethanwharris
Copy link
Contributor

We had a bit of a subtle bug here: Lightning-AI/pytorch-lightning#6730

Because LocalFileSystem.info returns t: 'link' for sym linked files / directories, isdir will always be false. This is inconsistent with the behaviour of os.path.isdir which follows sym links. We've been able to fix this by overriding isdir to just return os.path.isdir. I guess that this behaviour isn't intended? Not sure what the best fix is, overriding isdir works but is not the prettiest solution 😃

@martindurant
Copy link
Member

I think it would be fair to follow whatever os does. It will mean breaking the weak requirement that info["type"] be "directory", but I'm not too worried about that.

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 a pull request may close this issue.

2 participants