Skip to content

Commit

Permalink
fix: update S3 uri regex for AWS sessions (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
math411 committed Jan 30, 2024
1 parent 058108c commit 5667ecc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/braket/aws/aws_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ def parse_s3_uri(s3_uri: str) -> tuple[str, str]:
try:
# Object URL e.g. https://my-bucket.s3.us-west-2.amazonaws.com/my/key
# S3 URI e.g. s3://my-bucket/my/key
s3_uri_match = re.match("^https://([^./]+).[sS]3.[^/]+/(.*)$", s3_uri) or re.match(
"^[sS]3://([^./]+)/(.*)$", s3_uri
s3_uri_match = re.match(r"^https://([^./]+)\.[sS]3\.[^/]+/(.+)$", s3_uri) or re.match(
r"^[sS]3://([^./]+)/(.+)$", s3_uri
)
assert s3_uri_match
bucket, key = s3_uri_match.groups()
Expand Down

0 comments on commit 5667ecc

Please sign in to comment.