Closed
Description
.parent()
method of the paths pointing to the files in the root directory returns the filename with added slash, instead of root symbol.
This issue blocks PR in intake
Code to reproduce:
from upath import UPath
def get_dir(path):
return str(UPath(path).parent)
print(f"{get_dir('memory://cat.yml') = }") # 'memory://cat.yml/'
print(f"{get_dir('memory://dir/cat.yml') = }") # 'memory://dir/'
print(f"{get_dir('file://cat.yml') = }") # 'file://cat.yml/'
print(f"{get_dir('file://dir/cat.yml') = }") # 'file://dir/'