Skip to content

bpo-39010: Ignore error on cancelled future after end of loop. #20525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Lib/asyncio/proactor_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,14 @@ def _make_self_pipe(self):
def _loop_self_reading(self, f=None):
try:
if f is not None:
f.result() # may raise
try:
f.result() # may raise
except ConnectionResetError:
# when run_forever exits, the done callback added at
# the end of this function may still be pending and a subclass
# may have also cancelled the future. this will result in a
# spurious ConnectionResetError. ignore that error.
pass
f = self._proactor.recv(self._ssock, 4096)
except exceptions.CancelledError:
# _close_self_pipe() has been called, stop waiting for data
Expand Down