-
Notifications
You must be signed in to change notification settings - Fork 85
Closed
Description
This snippet gets a 403 error when reading an S3 URL with = in the object key:
import boto3
import os
import kvikio
import rmm
client = boto3.client(
's3',
aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'],
aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'],
aws_session_token=os.environ['AWS_SESSION_TOKEN'],
region_name=os.environ['AWS_DEFAULT_REGION']
)
bucket = ...
for key in ["test/date-2025-09-15", "test/date=2025-09-15"]:
client.put_object(Bucket=bucket, Key=key, Body=b'Hello, world!')
client.head_object(Bucket=bucket, Key=key)
print("boto3 done", key)
buf = rmm.DeviceBuffer(size=13)
f = kvikio.RemoteFile.open_s3(bucket, key)
f.read(buf)
print("kvikio done", key)Which outputs
boto3 done test/date-2025-09-15
kvikio done test/date-2025-09-15
boto3 done test/date=2025-09-15
Traceback (most recent call last):
File "/home/coder/kvikio/debug.py", line 23, in <module>
f = kvikio.RemoteFile.open_s3(bucket, key)
File "/home/coder/kvikio/python/kvikio/kvikio/remote_file.py", line 146, in open_s3
_get_remote_module().RemoteFile.open_s3(bucket_name, object_name, nbytes)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "kvikio/_lib/remote_handle.pyx", line 178, in kvikio._lib.remote_handle.RemoteFile.open_s3
File "kvikio/_lib/remote_handle.pyx", line 135, in kvikio._lib.remote_handle.RemoteFile._from_endpoint
RuntimeError: KvikIO failure at: /home/coder/kvikio/cpp/src/shim/libcurl.cpp:183: curl_easy_perform() error (The requested URL returned error: 403)
This is similar to curl/curl#13754, which is fixed in recent versions of curl. It's possible that this is fixed if we use a newer version of libcurl.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels