From: Erlend Egeberg Aasland Date: Thu, 24 Jun 2021 12:05:42 +0000 (+0200) Subject: bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) X-Git-Tag: v3.11.0a1~792 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5a52eef67997246b4235b5407e52a01e822ce56;p=thirdparty%2FPython%2Fcpython.git bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index cee97a83020b..11f4c3c2e8e5 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2443,9 +2443,14 @@ class ThreadedEchoServer(threading.Thread): self.server.conn_errors.append(str(e)) if self.server.chatty: handle_error("\n server: bad connection attempt from " + repr(self.addr) + ":\n") - self.running = False - self.server.stop() - self.close() + + # bpo-44229, bpo-43855, bpo-44237, and bpo-33450: + # Ignore spurious EPROTOTYPE returned by write() on macOS. + # See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/ + if e.errno != errno.EPROTOTYPE and sys.platform != "darwin": + self.running = False + self.server.stop() + self.close() return False else: self.server.shared_ciphers.append(self.sslconn.shared_ciphers())