https://github.com/python/cpython/commit/540b3d0a7fa7cd842f064f79b1410cbd6868bffa
commit: 540b3d0a7fa7cd842f064f79b1410cbd6868bffa
branch: main
author: Russell Keith-Magee <[email protected]>
committer: vstinner <[email protected]>
date: 2026-06-01T11:37:53+02:00
summary:
gh-148508: Add another common pattern for iOS SSL failures to test_ssl (#150442)
Match also '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'.
files:
M Lib/test/test_ssl.py
M Platforms/Apple/testbed/__main__.py
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index a60e96053b86d19..4f998ef2b02a69a 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -5698,17 +5698,24 @@ def non_linux_skip_if_other_okay_error(self, err):
return # Expect the full test setup to always work on Linux.
if (isinstance(err, (ConnectionResetError, ConnectionAbortedError)) or
(isinstance(err, OSError) and err.errno == errno.EINVAL) or
- re.search('wrong.version.number', str(getattr(err, "reason", "")),
re.I) or
- re.search('record.layer.failure', str(getattr(err, "reason", "")),
re.I)
+ re.search(
+ # Matches the following error messages:
+ # '[SSL: WRONG_VERSION_NUMBER] wrong version number
(_ssl.c:1123)'
+ # '[SSL: RECORD_LAYER_FAILURE] record layer failure
(_ssl.c:1109)'
+ # '[SSL: HTTP_REQUEST] http request (_ssl.c:1143)'
+ r'wrong.version.number|record.layer.failure|http.request',
+ str(getattr(err, "reason", "")),
+ re.IGNORECASE,
+ )
):
# On Windows the TCP RST leads to a ConnectionResetError
# (ECONNRESET) which Linux doesn't appear to surface to userspace.
# If wrap_socket() winds up on the "if connected:" path and doing
# the actual wrapping... we get an SSLError from OpenSSL. This is
# typically WRONG_VERSION_NUMBER. The same happens on iOS, but
- # RECORD_LAYER_FAILURE is the error.
+ # RECORD_LAYER_FAILURE or HTTP_REQUEST is the error.
#
- # While appropriate, neither is the scenario we're specifically
+ # While appropriate, these scenarios aren't what we're specifically
# trying to test. The way this test is written is known to work on
# Linux. We'll skip it anywhere else that it does not present as
# doing so.
diff --git a/Platforms/Apple/testbed/__main__.py
b/Platforms/Apple/testbed/__main__.py
index 0dd77ab8b827974..b3eed38571d9708 100644
--- a/Platforms/Apple/testbed/__main__.py
+++ b/Platforms/Apple/testbed/__main__.py
@@ -21,7 +21,7 @@
LOG_PREFIX_REGEX = re.compile(
r"^\d{4}-\d{2}-\d{2}" # YYYY-MM-DD
r"\s+\d+:\d{2}:\d{2}\.\d+\+\d{4}" # HH:MM:SS.ssssss+ZZZZ
- r"\s+iOSTestbed\[\d+:\w+\]" # Process/thread ID
+ r"\s+iOSTestbed\[\d+:\w+\] " # Process/thread ID
)
_______________________________________________
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]