summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-01-15 12:58:38 (GMT)
committerGitHub <noreply@github.com>2019-01-15 12:58:38 (GMT)
commitc9f872b0bdce5888f1879fa74e098bf4a05430c5 (patch)
treedf0e6acf0e9cd6827fffe8dc5fba0484c8a9c326 /Lib
parent3607ef43c4a1a24d44f39ff54a77fc0af5bfa09a (diff)
downloadcpython-c9f872b0bdce5888f1879fa74e098bf4a05430c5.zip
cpython-c9f872b0bdce5888f1879fa74e098bf4a05430c5.tar.gz
cpython-c9f872b0bdce5888f1879fa74e098bf4a05430c5.tar.bz2
bpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)
asyncio.ProactorEventLoop now catchs and logs send errors when the self-pipe is full: BaseProactorEventLoop._write_to_self() now catchs and logs OSError exceptions, as done by BaseSelectorEventLoop._write_to_self().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/proactor_events.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 3a1826e..a849be1 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -636,7 +636,13 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
f.add_done_callback(self._loop_self_reading)
def _write_to_self(self):
- self._csock.send(b'\0')
+ try:
+ self._csock.send(b'\0')
+ except OSError:
+ if self._debug:
+ logger.debug("Fail to write a null byte into the "
+ "self-pipe socket",
+ exc_info=True)
def _start_serving(self, protocol_factory, sock,
sslcontext=None, server=None, backlog=100,