- Package Name: azure-containerregistry==1.0.0b4, azure-core==1.16.0, azure-identity==1.6.0
- Operating System: OS X
- Python Version: Python 3.9.4
Describe the bug
Using azure.containerregistry.aio.ContainerRegistryClient.list_repository_names results in the following aiohttp warning:
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x10b264ee0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x10b2e84c0>, 1.472941262)]']
connector: <aiohttp.connector.TCPConnector object at 0x10b3020a0>
To Reproduce
Based on the sample from https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py I do run the following:
import asyncio
import os
class ListOperations(object):
def __init__(self, account_url=None):
if account_url is None:
self.account_url = os.environ["CONTAINERREGISTRY_ENDPOINT"]
else:
self.account_url = account_url
async def print_repository(self):
from azure.containerregistry.aio import (
ContainerRegistryClient,
)
from azure.identity.aio import AzureCliCredential
credential = AzureCliCredential()
client = ContainerRegistryClient(self.account_url, credential)
async with client:
async for repository in client.list_repository_names():
print(repository)
async def main():
sample = ListOperations()
await sample.print_repository()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Expected behavior
There is no warning about unclosed sessions and connectors.
Describe the bug
Using
azure.containerregistry.aio.ContainerRegistryClient.list_repository_namesresults in the following aiohttp warning:To Reproduce
Based on the sample from https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/containerregistry/azure-containerregistry/samples/async_samples/sample_delete_old_tags_async.py I do run the following:
Expected behavior
There is no warning about unclosed sessions and connectors.