https://github.com/python/cpython/commit/ea4027e179946040f534ba7f76cae51ee005739a
commit: ea4027e179946040f534ba7f76cae51ee005739a
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-02T18:08:29+02:00
summary:

gh-139504: Catch BrokenPipeError in ssl test_client_sigalgs_mismatch() (#139505)

Co-authored-by: Bénédikt Tran <[email protected]>

files:
M Lib/test/test_ssl.py

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index d6e06445d53179..09de32f8371ae9 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -4346,8 +4346,14 @@ def test_client_sigalgs_mismatch(self):
         client_context.set_client_sigalgs("rsa_pss_rsae_sha256")
         server_context.set_client_sigalgs("rsa_pss_rsae_sha384")
 
-        # Some systems return ConnectionResetError on handshake failures
-        with self.assertRaises((ssl.SSLError, ConnectionResetError)):
+        with self.assertRaises((
+            ssl.SSLError,
+            # On handshake failures, some systems raise a ConnectionResetError.
+            ConnectionResetError,
+            # On handshake failures, macOS may raise a BrokenPipeError.
+            # See https://github.com/python/cpython/issues/139504.
+            BrokenPipeError,
+        )):
             server_params_test(client_context, server_context,
                                chatty=True, connectionchatty=True,
                                sni_name=hostname)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to