You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an S3Path object with a path, which contains characters not representable by URIs, the to_uri function apparently call urlencode to encode those characters. This is fine. But when using this URI to create a new instance of S3Path, it should call urldecode, to decode the URI to the correct path. This is currently not done and results in errors of S3 being not able to find the key (of course, the key is wrong.)
Example
path=S3Path.from_uri("s3://bucket/test/2023-09-10T00:00:00.000Z.txt")
# S3Path('/bucket/test/2023-09-10T00:00:00.000Z.txt'), still correctpath.as_uri()
# s3://bucket/test/2023-09-10T00%3A00%3A00.000Z.txt now urlencodedS3Path.from_uri(path.as_uri())
# S3Path('/bucket/test/2023-09-10T00%3A00%3A00.000Z.txt') still encoded, S3 does not find this file
Workaround is of course to manually call urldecode on the string first, but IMO S3Path.from_uri should handle this, as it also calls urlencode when creating the URI.
The text was updated successfully, but these errors were encountered:
When creating an S3Path object with a path, which contains characters not representable by URIs, the to_uri function apparently call urlencode to encode those characters. This is fine. But when using this URI to create a new instance of S3Path, it should call urldecode, to decode the URI to the correct path. This is currently not done and results in errors of S3 being not able to find the key (of course, the key is wrong.)
Example
Workaround is of course to manually call urldecode on the string first, but IMO S3Path.from_uri should handle this, as it also calls urlencode when creating the URI.
The text was updated successfully, but these errors were encountered: