Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7853c76

Browse files
[3.12]GH-106684: Closeasyncio.StreamWriter whenasyncio.StreamWriter is not closed by application (GH-107650) (#107656)
GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (GH-107650)(cherry picked from commit41178e4)Co-authored-by: Kumar Aditya <kumaraditya@python.org>Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
1 parenta71500c commit7853c76

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎Lib/asyncio/streams.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ async def start_tls(self, sslcontext, *,
392392
self._transport=new_transport
393393
protocol._replace_writer(self)
394394

395+
def__del__(self):
396+
ifnotself._transport.is_closing():
397+
self.close()
398+
395399

396400
classStreamReader:
397401

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Close:class:`asyncio.StreamWriter` when it is not closed by application leading to memory leaks. Patch by Kumar Aditya.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp