| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1055,7 +1055,12 @@ def _create(cls, sock, server_side=False, do_handshake_on_connect=True, | |||
| 1055 | 1055 | notconn_pre_handshake_data = self.recv(1) | |
| 1056 | 1056 | except OSError as e: | |
| 1057 | 1057 | # EINVAL occurs for recv(1) on non-connected on unix sockets. | |
| 1058 | - if e.errno not in (errno.ENOTCONN, errno.EINVAL): | ||
| 1058 | + if e.errno in (errno.ENOTCONN, errno.EINVAL): | ||
| 1059 | + pass | ||
| 1060 | + elif sys.platform == 'cygwin' and e.errno == errno.EAGAIN: | ||
| 1061 | + # EAGAIN occurs on Cygwin. | ||
| 1062 | + pass | ||
| 1063 | + else: | ||
| 1059 | 1064 | raise | |
| 1060 | 1065 | notconn_pre_handshake_data = b'' | |
| 1061 | 1066 | self.setblocking(blocking) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -638,6 +638,7 @@ def test_refcycle(self): | |||
| 638 | 638 | del ss | |
| 639 | 639 | self.assertEqual(wr(), None) | |
| 640 | 640 | ||
| 641 | + @unittest.skipIf(sys.platform == 'cygwin', 'test hangs on Cygwin') | ||
| 641 | 642 | def test_wrapped_unconnected(self): | |
| 642 | 643 | # Methods on an unconnected SSLSocket propagate the original | |
| 643 | 644 | # OSError raise by the underlying socket object. | |
@@ -3631,7 +3632,7 @@ def test_wrong_cert_tls13(self): | |||
| 3631 | 3632 | OSError, | |
| 3632 | 3633 | 'alert unknown ca|EOF occurred|TLSV1_ALERT_UNKNOWN_CA|' | |
| 3633 | 3634 | 'closed by the remote host|Connection reset by peer|' | |
| 3634 | - 'Broken pipe' | ||
| 3635 | + 'Broken pipe|Software caused connection abort' | ||
| 3635 | 3636 | ): | |
| 3636 | 3637 | # TLS 1.3 perform client cert exchange after handshake | |
| 3637 | 3638 | s.write(b'data') | |
@@ -4585,6 +4586,8 @@ def test_client_sigalgs_mismatch(self): | |||
| 4585 | 4586 | ssl.SSLError, | |
| 4586 | 4587 | # On handshake failures, some systems raise a ConnectionResetError. | |
| 4587 | 4588 | ConnectionResetError, | |
| 4589 | + # On handshake failures, Cygwin raises ConnectionAbortedError. | ||
| 4590 | + ConnectionAbortedError, | ||
| 4588 | 4591 | # On handshake failures, macOS may raise a BrokenPipeError. | |
| 4589 | 4592 | # See https://github.com/python/cpython/issues/139504. | |
| 4590 | 4593 | BrokenPipeError, | |
@@ -5693,7 +5696,7 @@ def run(self): | |||
| 5693 | 5696 | def non_linux_skip_if_other_okay_error(self, err): | |
| 5694 | 5697 | if sys.platform in ("linux", "android"): | |
| 5695 | 5698 | return # Expect the full test setup to always work on Linux. | |
| 5696 | - if (isinstance(err, ConnectionResetError) or | ||
| 5699 | + if (isinstance(err, (ConnectionResetError, ConnectionAbortedError)) or | ||
| 5697 | 5700 | (isinstance(err, OSError) and err.errno == errno.EINVAL) or | |
| 5698 | 5701 | re.search('wrong.version.number', str(getattr(err, "reason", "")), re.I) or | |
| 5699 | 5702 | re.search('record.layer.failure', str(getattr(err, "reason", "")), re.I) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments