-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cloudpathlib does not automatically resolve paths that contain ..
#494
Comments
..
..
Thanks for raising, since the behavior here could be surprising. This affects all providers, not just Azure. Unfortunately, I don't think we will implement automatically resolving literal We have a few options.
import posixpath
...
class CloudPath:
...
def resolve(self):
return self._new_cloudpath(posixpath.normpath(self._path))
In [1]: from cloudpathlib import CloudPath
In [2]: CloudPath("s3://bucket/folder1/") / "../hello.txt"
Out[2]: S3Path('s3://bucket/hello.txt') With this in mind, I am going to close #495 since it wouldn't be the right fix for the issue you mention. |
Thank you very much for all the information! Since Azure has quite a lot of strange things, I totally forget to validate it against what I know about S3 which is basically a key-value store hence having After I posted this issue I played with the code a bit more, and I eventually created Azure/azure-sdk-for-python#38992. Funnily, even the REST API on the Azure side is not consistent ;-) I think it is good to stress out that Wrapping all together, I think this is a bug:
Or documentation should mention that |
When
..
are in the path, the AzureBlobPath fails to list directory withInterestingly, the metadata to identify whether a path exists, is dir, etc., works just fine.
In my opinion, this should work since
pathlib.Path
works this way.The text was updated successfully, but these errors were encountered: