fsspec / universal_pathlib

pathlib api extended to use fsspec backends
MIT License
251 stars 44 forks source link

s3 prefix with a + character causes incorrect path when iterating #45

Closed bgt-cdedels closed 2 years ago

bgt-cdedels commented 2 years ago

If you have an object in s3 with an + character in the prefix, iterdir creates incorrect paths.

from upath import UPath
for in_path in UPath("s3://my_bucket/manual__2022-02-19T14:31:25.891270+00:00/dir").iterdir():
    print(in_path)

The actual output is: s3://my_bucket/manual__2022-02-19T14:31:25.891270+00:00/dir/my_bucket/manual__2022-02-19T14:31:25.891270+00:00/dir/file1

The expected output is: s3://my_bucket/manual__2022-02-19T14:31:25.891270+00:00/dir/file1