This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mdk
Recipients asvetlov, mdk, yselivanov
Date 2022-01-09.15:04:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641740693.62.0.185226666966.issue46318@roundup.psfhosted.org>
In-reply-to
Content
Originally opened at: https://github.com/aio-libs/aiohttp/issues/6071

Reproducer:


    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, "python.org", 443, ssl=True)
        while True:
            print("Waiting for the server to close the connection...")
            await asyncio.sleep(10)


    asyncio.run(main())


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/sslproto.py:320: 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/sslproto.py", lineno 445
        self._app_transport = _SSLProtocolTransport(self._loop, self)

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