Long story short
When I use container.attach() it opens a connection as expected, but the underlying aiohttp response object is not closed. It leads to a warnings:
ResourceWarning: Unclosed response <ClientResponse(http://10.1.0.19:2375/v1.39/containers/912a83018d776abf6bc7e6ad0a7abca727a1dc8df40e286681abe779b8b3a473/attach?detachKeys=&logs=1&stdin=0&stdout=1&stderr=1&stream=1) [101 UPGRADED]>
- Expected behaviour: no warning, response object closed
- Actual behaviour: warning thrown about unclosed response object.
Additional details:
In the following code
|
async def close(self) -> None: |
|
if self._resp is not None: |
|
return |
|
if self._closed: |
|
return |
|
assert self._resp is not None |
Line if self._resp is not None: looks very suspicious, I think that the not there is a bug.
Long story short
When I use
container.attach()it opens a connection as expected, but the underlying aiohttp response object is not closed. It leads to a warnings:Additional details:
In the following code
aiodocker/aiodocker/stream.py
Lines 111 to 116 in bb149e8
Line
if self._resp is not None:looks very suspicious, I think that thenotthere is a bug.