]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-139504: Catch BrokenPipeError in ssl test_client_sigalgs_mismatch() (#139505)
authorVictor Stinner <vstinner@python.org>
Thu, 2 Oct 2025 16:08:29 +0000 (18:08 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Oct 2025 16:08:29 +0000 (18:08 +0200)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Lib/test/test_ssl.py

index d6e06445d53179aa68a788a0ed2d37b8a184d917..09de32f8371ae988b004478d9d81ec078fb5a2ee 100644 (file)
@@ -4346,8 +4346,14 @@ class ThreadedTests(unittest.TestCase):
         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)