Skip to content

is_dir() and is_file() are not working properly for gs #493

@shanirosen-airis

Description

@shanirosen-airis

Hey,
I tried to use the is_dir and is_file functions from both s3 and gs, but discovered that:

from cloudpathlib import AnyPath

p1 = AnyPath("gs://my-bucket/test/test_dir")
p2 = AnyPath("gs://my-bucket/test/test_dir/")

print(p1.is_dir())  # True
print(p2.is_dir())  # False

p1 = AnyPath("s3://my-bucket/test/test_dir")
p2 = AnyPath("s3://my-bucket/test/test_dir/")

print(p1.is_dir())  # True
print(p2.is_dir())  # True

looks like in gs everything is classified as a file unless I strip the last "/".
Any Idea why is this happening?
using cloudpathlib==0.20.0

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCPdesign decisionIssues that are waiting on making a final decision about the design of the API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions