From 609d2e91be5659bc5c9c9aa01f7a8c1809439822 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Mon, 26 Jun 2023 21:22:21 -0600 Subject: [PATCH] Add patch to remove match_hostname import --- python-gevent-py312.patch | 19 +++++++++++++++++++ python-gevent.spec | 11 ++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 python-gevent-py312.patch diff --git a/python-gevent-py312.patch b/python-gevent-py312.patch new file mode 100644 index 0000000..1461cc4 --- /dev/null +++ b/python-gevent-py312.patch @@ -0,0 +1,19 @@ +diff -up gevent-22.10.2/src/gevent/_ssl3.py.py312 gevent-22.10.2/src/gevent/_ssl3.py +--- gevent-22.10.2/src/gevent/_ssl3.py.py312 2022-10-31 12:53:52.000000000 -0600 ++++ gevent-22.10.2/src/gevent/_ssl3.py 2023-06-26 19:07:10.247869058 -0600 +@@ -50,7 +50,6 @@ from ssl import SSL_ERROR_WANT_READ + from ssl import SSL_ERROR_WANT_WRITE + from ssl import PROTOCOL_SSLv23 + from ssl import SSLObject +-from ssl import match_hostname + from ssl import CHANNEL_BINDING_TYPES + from ssl import CERT_REQUIRED + from ssl import DER_cert_to_PEM_cert +@@ -680,6 +679,7 @@ class SSLSocket(socket): + if not self.server_hostname: + raise ValueError("check_hostname needs server_hostname " + "argument") ++ from ssl import match_hostname + match_hostname(self.getpeercert(), self.server_hostname) # pylint:disable=deprecated-method + + if hasattr(SSLObject, '_create'): diff --git a/python-gevent.spec b/python-gevent.spec index 72b6ec9..8e80997 100644 --- a/python-gevent.spec +++ b/python-gevent.spec @@ -4,7 +4,7 @@ Name: python-%{modname} Version: 22.10.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A coroutine-based Python networking library License: MIT @@ -13,6 +13,9 @@ Source0: %{pypi_source %{modname} %{version} tar.gz} # Remove the usage of assertRaisesRegexp unit test alias removed in Python 3.12 Patch: https://github.com/gevent/gevent/pull/1944.patch +# Remove the import of match_hostname deprecated in 3.7 and removed in Python 3.12 +# https://github.com/gevent/gevent/pull/1963 +Patch: python-gevent-py312.patch BuildRequires: gcc BuildRequires: c-ares-devel @@ -34,10 +37,9 @@ Features include: %package -n python3-%{modname} Summary: %{summary} -%{?python_provide:%python_provide python3-%{modname}} BuildRequires: python3-devel BuildRequires: python3-Cython -BuildRequires: python3-greenlet-devel >= 1.1.0 +BuildRequires: python3-greenlet-devel >= 2.0.0 BuildRequires: python3-setuptools # For tests BuildRequires: python3-dns @@ -98,6 +100,9 @@ cd src/gevent/tests && GEVENT_FILE=thread %__python3 -mgevent.tests test__*subpr %{python3_sitearch}/%{modname}* %changelog +* Tue Jun 27 2023 Orion Poplawski - 22.10.2-3 +- Add patch to remove match_hostname import + * Thu Jun 15 2023 Python Maint - 22.10.2-2 - Rebuilt for Python 3.12