urlpath
urlpath copied to clipboard
Erroneous double slash in returned URL
I am trying urlpath 1.1.4 with Python 3.8. The output it's producing has an extra slash:
>>> from urlpath import URL
>>> URL('s3://mybucket/') / 'myprefix'
URL('s3://mybucket//myprefix')
There is an extra slash above between mybucket and myprefix which shouldn't exist.
Compare it with the output of pathlib which is undesirable in another way, but doesn't have this extra slash in that location:
>>> from pathlib import Path
>>> Path('s3://mybucket/') / 'myprefix'
PosixPath('s3:/mybucket/myprefix')
Possibly related: The .with_scheme method adds a triple slash.
url = URL("www.abc.com").with.scheme("https")
print(url) # prints https:///www.abc.com