Skip to content

Commit b3fac29

Browse files
miss-islingtonErlend Egeberg Aasland
and
Erlend Egeberg Aasland
authored
bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893)
(cherry picked from commit b5a52eef67997246b4235b5407e52a01e822ce56) Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent 7335870 commit b3fac29

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Lib/test/test_ssl.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -2443,9 +2443,14 @@ def wrap_conn(self):
24432443
self.server.conn_errors.append(str(e))
24442444
if self.server.chatty:
24452445
handle_error("\n server: bad connection attempt from " + repr(self.addr) + ":\n")
2446-
self.running = False
2447-
self.server.stop()
2448-
self.close()
2446+
2447+
# bpo-44229, bpo-43855, bpo-44237, and bpo-33450:
2448+
# Ignore spurious EPROTOTYPE returned by write() on macOS.
2449+
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
2450+
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
2451+
self.running = False
2452+
self.server.stop()
2453+
self.close()
24492454
return False
24502455
else:
24512456
self.server.shared_ciphers.append(self.sslconn.shared_ciphers())

0 commit comments

Comments
 (0)