universal_pathlib icon indicating copy to clipboard operation
universal_pathlib copied to clipboard

Glob on s3 bucket should be coherent with other implementations?

Open rdbisme opened this issue 3 years ago • 0 comments

Given this

print([f for f in path.glob("**/*") if f.is_file() ])

if path is a Path from pathlib holding a folder, that would return all the files recursively contained in that folder. I'd expect that:

path = UPath("s3://my-bucket")
print([f for f in path.glob("**/*") if f.is_file()])

would return all files, but instead it returns nothing. Using /**/* works instead.

Is this a bug or a feature?

My use case is providing a generic "folder" path, and being able to walk all the files within it recursively

rdbisme avatar Oct 18 '22 19:10 rdbisme