public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-cheroot] rawhide: Patch test_https_over_http_error to accept either SSL error string
@ 2026-10-26 17:40 Dan Radez
0 siblings, 0 replies; only message in thread
From: Dan Radez @ 2026-10-26 17:40 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-cheroot
Branch : rawhide
Commit : baf686e0cb9d8bd75f7e86d351a33133aab77a31
Author : Dan Radez <dan@radez.net>
Date : 2026-10-26T13:39:02-04:00
Stats : +63/-6 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-cheroot/c/baf686e0cb9d8bd75f7e86d351a33133aab77a31?branch=rawhide
Log:
Patch test_https_over_http_error to accept either SSL error string
Replaces the deselect of test_https_over_http_error with a patch that
accepts 'wrong version number' or 'record layer failure', since the
OpenSSL version alone does not predict which one is reported
(cherrypy/cheroot#645).
---
diff --git a/0001-accept-either-ssl-error-string-in-tests.patch b/0001-accept-either-ssl-error-string-in-tests.patch
new file mode 100644
index 0000000..2d509c7
--- /dev/null
+++ b/0001-accept-either-ssl-error-string-in-tests.patch
@@ -0,0 +1,57 @@
+From 155b4b0063f281360645b13ca284075c1f3a8226 Mon Sep 17 00:00:00 2001
+From: Dan Radez <dradez@redhat.com>
+Date: Mon, 26 Oct 2026 10:26:17 -0400
+Subject: [PATCH] Accept either SSL error string in test_https_over_http_error
+
+The error raised when speaking HTTPS to a plain HTTP port may be
+reported as 'record layer failure' or 'wrong version number' depending
+on the OpenSSL and Python versions in use, so the OpenSSL version alone
+does not predict it:
+
+E AssertionError: assert 'record layer failure' in
+ '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1147)'
+
+Accept either string rather than guessing from the OpenSSL version.
+
+Fixes: #645
+---
+ cheroot/test/test_ssl.py | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/cheroot/test/test_ssl.py b/cheroot/test/test_ssl.py
+index 115237f..4c87a8a 100644
+--- a/cheroot/test/test_ssl.py
++++ b/cheroot/test/test_ssl.py
+@@ -27,7 +27,6 @@ from cryptography.hazmat.primitives.serialization import (
+
+ from .._compat import (
+ IS_ABOVE_OPENSSL10,
+- IS_ABOVE_OPENSSL31,
+ IS_CI,
+ IS_LINUX,
+ IS_MACOS,
+@@ -686,14 +685,15 @@ def test_https_over_http_error(http_server, ip_addr):
+ http.client.HTTPSConnection(
+ f'{interface}:{port}',
+ ).request('GET', '/')
+- expected_substring = (
+- 'record layer failure'
+- if IS_ABOVE_OPENSSL31
+- else 'wrong version number'
++ # The reported string depends on both the OpenSSL and Python versions:
++ # 'wrong version number' or 'record layer failure' (OpenSSL 3.2+)
++ expected_substrings = (
++ ('wrong version number', 'record layer failure')
+ if IS_ABOVE_OPENSSL10
+- else 'unknown protocol'
++ else ('unknown protocol',)
+ )
+- assert expected_substring in ssl_err.value.args[-1]
++ err_msg = ssl_err.value.args[-1]
++ assert any(s in err_msg for s in expected_substrings), err_msg
+
+
+ @pytest.mark.parametrize(
+--
+2.56.0
+
diff --git a/python-cheroot.spec b/python-cheroot.spec
index 14d778c..17f2ba7 100644
--- a/python-cheroot.spec
+++ b/python-cheroot.spec
@@ -11,6 +11,10 @@ Summary: Highly-optimized, pure-python HTTP server
License: LicenseRef-Callaway-BSD
URL: https://github.com/cherrypy/cheroot
Source0: %{pypi_source}
+
+# https://github.com/cherrypy/cheroot/issues/645
+Patch0: 0001-accept-either-ssl-error-string-in-tests.patch
+
BuildArch: noarch
%description
@@ -65,7 +69,7 @@ Documentation for cheroot
%endif
%prep
-%autosetup -n %{pypi_name}-%{version}
+%autosetup -p1 -n %{pypi_name}-%{version}
# Remove pytest processes directive
sed -i 's/ --numprocesses=auto//' pytest.ini
@@ -112,11 +116,7 @@ rm -rf html/.{doctrees,buildinfo}
rm -rf %{buildroot}%{python3_sitelib}/docs/
%check
-# test_https_over_http_error expects an OpenSSL >=3.1 error string ('record
-# layer failure'), but Python's ssl module reports the mnemonic 'wrong version
-# number' instead. Upstream: https://github.com/cherrypy/cheroot/issues/645
-LANG=C.utf-8 %{__python3} -m pytest --ignore=build -W ignore::DeprecationWarning -p no:unraisableexception \
- --deselect cheroot/test/test_ssl.py::test_https_over_http_error
+LANG=C.utf-8 %{__python3} -m pytest --ignore=build -W ignore::DeprecationWarning -p no:unraisableexception
%files -n python3-%{pypi_name} -f %{pyproject_files}
%license LICENSE.md
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-26 17:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 17:40 [rpms/python-cheroot] rawhide: Patch test_https_over_http_error to accept either SSL error string Dan Radez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox