[Python-checkins] gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (#106504)
kumaraditya303
webhook-mailer at python.org
Fri Jul 7 07:41:58 EDT 2023
https://github.com/python/cpython/commit/3e5ce7968f5ab715f649e296e1f6b499621b8091
commit: 3e5ce7968f5ab715f649e296e1f6b499621b8091
branch: main
author: Andrew Geng <pteromys at gmail.com>
committer: kumaraditya303 <59607654+kumaraditya303 at users.noreply.github.com>
date: 2023-07-07T17:11:54+05:30
summary:
gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (#106504)
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