GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650)
(cherry picked from commit
41178e41995992bbe417f94bce158de93f9e3188)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
self._transport = new_transport
protocol._replace_writer(self)
+ def __del__(self):
+ if not self._transport.is_closing():
+ self.close()
+
class StreamReader:
--- /dev/null
+Close :class:`asyncio.StreamWriter` when it is not closed by application leading to memory leaks. Patch by Kumar Aditya.