From b71ec3d8c8cbe6411fc734a1811e66fe7ab839a4 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 16 Jun 2021 12:42:54 +0200 Subject: [PATCH] Restore ssl_match_hostname unbundle wrapper This is to prevent pipenv failure when it creates Pipfile.lock in Python2 environment. --- python-urllib3.spec | 6 ++++-- ssl_match_hostname_py3.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ssl_match_hostname_py3.py diff --git a/python-urllib3.spec b/python-urllib3.spec index e98a415..18b8ea0 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -11,6 +11,8 @@ Summary: Python HTTP library with thread-safe connection pooling and file License: MIT URL: https://github.com/urllib3/urllib3 Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz +# Unbundle ssl_match_hostname since we depend on it +Source1: ssl_match_hostname_py3.py BuildArch: noarch %description @@ -90,10 +92,10 @@ sed -i -e 's/^import mock/from unittest import mock/' \ # Unbundle the Python 3 build rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six.* -rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/_implementation.py -rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.* +rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/ mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/ +cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \ %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ diff --git a/ssl_match_hostname_py3.py b/ssl_match_hostname_py3.py new file mode 100644 index 0000000..99d425a --- /dev/null +++ b/ssl_match_hostname_py3.py @@ -0,0 +1 @@ +from ssl import match_hostname, CertificateError