Author mdk
Recipients asvetlov, mdk, yselivanov
Date 2022-01-09.15:04:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Originally opened at:


    import asyncio

    class DumbProtocol(asyncio.Protocol):
        def connection_made(self, transport):
            print("Connection made")
            self.transport = transport

        def data_received(self, data):
            print("Data received: {!r}".format(data))

    async def main():
        loop = asyncio.get_running_loop()

        for i in range(2):
            _, _ = await loop.create_connection(DumbProtocol, "", 443, ssl=True)
        while True:
            print("Waiting for the server to close the connection...")
            await asyncio.sleep(10)

Using this reproducer I get a ResourceWarning:

    Data received: b"HTTP/1.0 408 Request Time-out\r\nCache-Control: no-cache\r\nConnection: close\r\nContent-Type: text/html\r\n\r\n<html><body><h1>408 Request Time-out</h1>\nYour browser didn't send a complete request in time.\n</body></html>\n\n"
    /usr/lib/python3.9/asyncio/ ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7f9328214050>
      _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    Object allocated at (most recent call last):
      File "/usr/lib/python3.9/asyncio/", lineno 445
        self._app_transport = _SSLProtocolTransport(self._loop, self)

I can also reproduce it on current master.
Date User Action Args
2022-01-09 15:04:53mdksetrecipients: + mdk, asvetlov, yselivanov
2022-01-09 15:04:53mdksetmessageid: <>
2022-01-09 15:04:53mdklinkissue46318 messages
2022-01-09 15:04:53mdkcreate