[Python-checkins] bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) (GH-26895)

pablogsal webhook-mailer at python.org
Thu Jun 24 10:34:42 EDT 2021


https://github.com/python/cpython/commit/71ba16b21cb35923098026117b5e6d823c5f5707
commit: 71ba16b21cb35923098026117b5e6d823c5f5707
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2021-06-24T15:34:34+01:00
summary:

bpo-44229: Ignore spurious EPROTOTYPE on macOS in test_ssl (GH-26893) (GH-26895)

(cherry picked from commit b5a52eef67997246b4235b5407e52a01e822ce56)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland at innova.no>

files:
M Lib/test/test_ssl.py

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 1fa024191893e6..32bb2aa37d320b 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2380,9 +2380,14 @@ def wrap_conn(self):
                 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())



More information about the Python-checkins mailing list