Description
S3 Multi-Region Access Points (MRAPs) use ARN-based URLs instead of a plain bucket name:
s3://arn:aws:s3::123456789012:accesspoint/my-mrap.mrap/path/to/file.txt
Currently, S3Path parses the bucket by splitting on the first / after s3://, which gives arn:aws:s3::123456789012:accesspoint — cutting off the .mrap suffix. This causes bucket and key to be computed incorrectly, breaking all boto3 calls since they receive the wrong Bucket and Key parameters.
Current behavior
p = S3Path("s3://arn:aws:s3::123456789012:accesspoint/my-mrap.mrap/folder/file.txt")
p.bucket # "arn:aws:s3::123456789012:accesspoint" ← wrong
p.key # "my-mrap.mrap/folder/file.txt" ← wrong
Expected behavior
p.bucket # "arn:aws:s3::123456789012:accesspoint/my-mrap.mrap" ← full ARN
p.key # "folder/file.txt" ← correct
Proposed fix
Override the bucket property on S3Path to detect MRAP ARNs via a regex and return the full ARN when matched, falling back to the existing behaviour for regular bucket names.
Description
S3 Multi-Region Access Points (MRAPs) use ARN-based URLs instead of a plain bucket name:
Currently,
S3Pathparses thebucketby splitting on the first/afters3://, which givesarn:aws:s3::123456789012:accesspoint— cutting off the.mrapsuffix. This causesbucketandkeyto be computed incorrectly, breaking all boto3 calls since they receive the wrongBucketandKeyparameters.Current behavior
Expected behavior
Proposed fix
Override the
bucketproperty onS3Pathto detect MRAP ARNs via a regex and return the full ARN when matched, falling back to the existing behaviour for regular bucket names.