summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-24 12:25:41 (GMT)
committerGitHub <noreply@github.com>2021-06-24 12:25:41 (GMT)
commit0796e21fea31fe7b697d84c8d03186817792c458 (patch)
treea36c0ab007f5138316671d22cca89f07b8095d88
parent5ed7827b1620f5b3729bc9767158d24a33863fa9 (diff)
downloadcpython-0796e21fea31fe7b697d84c8d03186817792c458.zip
cpython-0796e21fea31fe7b697d84c8d03186817792c458.tar.gz
cpython-0796e21fea31fe7b697d84c8d03186817792c458.tar.bz2
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
(cherry picked from commit b5a52eef67997246b4235b5407e52a01e822ce56) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
-rw-r--r--Lib/test/test_ssl.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index c69f0d8..f928bce 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2385,9 +2385,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())