Skip to content

Commit 0796e21

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 b5a52ee) Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent 5ed7827 commit 0796e21

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Lib/test/test_ssl.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,9 +2385,14 @@ def wrap_conn(self):
23852385
self.server.conn_errors.append(str(e))
23862386
if self.server.chatty:
23872387
handle_error("\n server: bad connection attempt from " + repr(self.addr) + ":\n")
2388-
self.running = False
2389-
self.server.stop()
2390-
self.close()
2388+
2389+
# bpo-44229, bpo-43855, bpo-44237, and bpo-33450:
2390+
# Ignore spurious EPROTOTYPE returned by write() on macOS.
2391+
# See also http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
2392+
if e.errno != errno.EPROTOTYPE and sys.platform != "darwin":
2393+
self.running = False
2394+
self.server.stop()
2395+
self.close()
23912396
return False
23922397
else:
23932398
self.server.shared_ciphers.append(self.sslconn.shared_ciphers())

0 commit comments

Comments
 (0)