Skip to content

fix(core): use self.boto_session for the custom S3 endpoint in LocalSession - #6424

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-session-s3-endpoint-url
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-session-s3-endpoint-url

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

LocalSession._initialize falls back to boto3.Session() when no boto_session is passed. The s3_endpoint_url branch, however, builds the S3 resource and client from the boto_session argument instead of self.boto_session:

if self.s3_endpoint_url is not None:
    self.s3_resource = boto_session.resource("s3", endpoint_url=self.s3_endpoint_url)

So LocalSession(s3_endpoint_url="http://localhost:9000") without an explicit boto session fails with AttributeError: 'NoneType' object has no attribute 'resource'.

This change uses self.boto_session, as the non-endpoint branch already does.

Testing:

  • New test_local_session_with_s3_endpoint_and_default_boto_session. It fails before this change.
  • tests/unit/local: 177 passed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ession

LocalSession._initialize falls back to boto3.Session() when no boto_session
is passed, but the s3_endpoint_url branch then created the S3 resource and
client from the boto_session argument instead of self.boto_session. So
LocalSession(s3_endpoint_url=...) without an explicit boto session failed
with AttributeError: 'NoneType' object has no attribute 'resource'.

This branch had an error being deployed

1 failed deployment
manual-approval — 44924ecc Deployed Oct 10, 2026 by AkshayShah03 via wait-for-approval #1700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant