[Python-checkins] [3.12] gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (GH-106504) (#106514)

kumaraditya303 webhook-mailer at python.org
Fri Jul 7 08:08:25 EDT 2023


https://github.com/python/cpython/commit/7e883d76c0a17a7c97782384d8e2ec025eade91b
commit: 7e883d76c0a17a7c97782384d8e2ec025eade91b
branch: 3.12
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: kumaraditya303 <59607654+kumaraditya303 at users.noreply.github.com>
date: 2023-07-07T12:08:22Z
summary:

[3.12] gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (GH-106504) (#106514)

gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (GH-106504)
(cherry picked from commit 3e5ce7968f5ab715f649e296e1f6b499621b8091)

Co-authored-by: Andrew Geng <pteromys at gmail.com>

files:
A Misc/NEWS.d/next/Library/2023-07-07-03-05-58.gh-issue-106503.ltfeiH.rst
M Lib/asyncio/selector_events.py
M Misc/ACKS

diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index fa2422b7fba4a..f895750e3cf95 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -1202,6 +1202,7 @@ def _reset_empty_waiter(self):
 
     def close(self):
         self._read_ready_cb = None
+        self._write_ready = None
         super().close()
 
 
diff --git a/Misc/ACKS b/Misc/ACKS
index 454b63155f013..ef0029a7e4119 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -615,6 +615,7 @@ Marius Gedminas
 Jan-Philip Gehrcke
 Thomas Gellekum
 Gabriel Genellina
+Andrew Geng
 Philip Georgi
 Christos Georgiou
 Elazar (אלעזר) Gershuni
diff --git a/Misc/NEWS.d/next/Library/2023-07-07-03-05-58.gh-issue-106503.ltfeiH.rst b/Misc/NEWS.d/next/Library/2023-07-07-03-05-58.gh-issue-106503.ltfeiH.rst
new file mode 100644
index 0000000000000..b8dd850386e86
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-07-07-03-05-58.gh-issue-106503.ltfeiH.rst
@@ -0,0 +1,2 @@
+Fix ref cycle in :class:`!asyncio._SelectorSocketTransport` by removing
+``_write_ready`` in ``close``.



More information about the Python-checkins mailing list