terricain / aioboto3

Wrapper to use boto3 resources with the aiobotocore async backend
Apache License 2.0
719 stars 74 forks source link

Issue with close() method on http session #258

Closed chrisBLIT closed 2 years ago

chrisBLIT commented 2 years ago

Async AWS SDK for Python version: aioboto3: 9.3.1 Python version: 3.9

Description

Trying to use the latest version of aioboto3, in the latest version resource is no longer used instead we switched over to using below as described

session = aioboto3.Session()
    async with session.resource("s3") as s3

we have some async tests, using something similar to mock server and contest described in the test examples in aioboto3. we are seeing an issue in those async tests, which I think is related to a change added in previous release to do with "Fix missing close() method on http session". the error we are seeing is below:

AttributeError: 'NoneType' object has no attribute '__aexit__'

the tests work fine, the aioboto3.Session() it seems cleans up and closes the session, however in the mock server it also tries to clean up the session and we get the error below. we are handling the error now for the meantime. wondering If its a good idea for that async def close(self): that a check is added to see if the session is already None.

chrisBLIT commented 2 years ago

closing this, as its botocore. oops