Skip to content

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

@ethanwharris

Description

@ethanwharris

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 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions