Skip to content

Reject synchronous botocore Session in S3FileSystem - #1102

Open
M-Colley wants to merge 1 commit into
fsspec:mainfrom
M-Colley:fix/issue-385-validate-session
Open

M-Colley wants to merge 1 commit into
fsspec:mainfrom
M-Colley:fix/issue-385-validate-session

Conversation

@M-Colley

@M-Colley M-Colley commented Dec 1, 2026

Copy link
Copy Markdown

S3FileSystem.init now raises TypeError immediately when given a synchronous botocore.session.Session instance. Previously, initialization accepted synchronous botocore sessions and failed later inside set_session with AttributeError because the created S3 client lacked aenter. Fixes #385.

This change checks session in S3FileSystem.init and rejects botocore.session.Session instances unless they subclass aiobotocore.session.AioSession. Regression tests in s3fs/tests/test_session_validation.py verify that botocore.session.Session raises TypeError and that aiobotocore.session.AioSession succeeds.

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.

'S3' object has no attribute '__aenter__'

1 participant