Skip to content

Commit bb80f6a

Browse files
miss-islingtonFidget-Spinner
andauthoredOct 27, 2022
gh-98703: Fix asyncio proactor_events calling _call_connection_lost multiple times (GH-98704)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 8a75542) Co-authored-by: Ken Jin <kenjin@python.org>
1 parent 5074c35 commit bb80f6a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎Lib/asyncio/proactor_events.py

+2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ def _force_close(self, exc):
152152
self._loop.call_soon(self._call_connection_lost, exc)
153153

154154
def _call_connection_lost(self, exc):
155+
if self._called_connection_lost:
156+
return
155157
try:
156158
self._protocol.connection_lost(exc)
157159
finally:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix :meth:`asyncio.StreamWriter.drain` to call ``protocol.connection_lost``
2+
callback only once on Windows.

0 commit comments

Comments
 (0)
Please sign in to comment.