diff --git a/python-urllib3-unbundle.patch b/python-urllib3-unbundle.patch index 4d74260..1b5dd64 100644 --- a/python-urllib3-unbundle.patch +++ b/python-urllib3-unbundle.patch @@ -18,16 +18,22 @@ Index: urllib3-1.5/urllib3/connectionpool.py =================================================================== --- urllib3-1.5.orig/urllib3/connectionpool.py +++ urllib3-1.5/urllib3/connectionpool.py -@@ -51,8 +51,14 @@ from .exceptions import ( +@@ -51,8 +51,20 @@ from .exceptions import ( TimeoutError, ) -from .packages.ssl_match_hostname import match_hostname, CertificateError -from .packages import six +try: -+ from backports.ssl_match_hostname import match_hostname, CertificateError ++ # python3.2+ ++ from ssl import match_hostname, CertificateError +except ImportError: -+ from .packages.ssl_match_hostname import match_hostname, CertificateError ++ try: ++ # Older python where the backport from pypi is installed ++ from backports.ssl_match_hostname import match_hostname, CertificateError ++ except ImportError: ++ # Other older python we use our bundled copy ++ from .packages.ssl_match_hostname import match_hostname, CertificateError +try: + import six +except ImportError: @@ -106,15 +112,21 @@ Index: urllib3-1.5/test/test_connectionpool.py =================================================================== --- urllib3-1.5.orig/test/test_connectionpool.py +++ urllib3-1.5/test/test_connectionpool.py -@@ -1,7 +1,10 @@ +@@ -1,7 +1,16 @@ import unittest from urllib3.connectionpool import connection_from_url, HTTPConnectionPool -from urllib3.packages.ssl_match_hostname import CertificateError +try: -+ from backports.ssl_match_hostname import CertificateError ++ # python3.2+ ++ from ssl import CertificateError +except ImportError: -+ from urllib3.packages.ssl_match_hostname import CertificateError ++ try: ++ # Older python where the backport from pypi is installed ++ from backports.ssl_match_hostname import CertificateError ++ except ImportError: ++ # Other older python we use our bundled copy ++ from urllib3.packages.ssl_match_hostname import CertificateError from urllib3.exceptions import ( ClosedPoolError, EmptyPoolError, @@ -134,3 +146,17 @@ Index: urllib3-1.5/test/test_filepost.py BOUNDARY = '!! test boundary !!' +Index: urllib3-1.5/setup.py +=================================================================== +--- urllib3-1.5.orig/setup.py ++++ urllib3-1.5/setup.py +@@ -44,8 +44,7 @@ setup(name='urllib3', + author_email='andrey.petrov@shazow.net', + url='http://urllib3.readthedocs.org/', + license='MIT', +- packages=['urllib3', 'dummyserver', 'urllib3.packages', +- 'urllib3.packages.ssl_match_hostname', ++ packages=['urllib3', 'dummyserver', 'urllib3', + ], + requires=requirements, + tests_require=tests_requirements, diff --git a/python-urllib3.spec b/python-urllib3.spec index 63fee67..d888547 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -8,7 +8,7 @@ Name: python-%{srcname} Version: 1.5 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Python HTTP library with thread-safe connection pooling and file post License: MIT @@ -39,8 +39,7 @@ BuildArch: noarch Requires: ca-certificates Requires: python-six -### TODO: In review https://bugzilla.redhat.com/show_bug.cgi?id=885013 -# Requires: python-backports-ssl_match_hostname +Requires: python-backports-ssl_match_hostname %if 0%{?rhel} <= 6 BuildRequires: python-ordereddict Requires: python-ordereddict @@ -51,6 +50,7 @@ BuildRequires: python2-devel BuildRequires: python-nose BuildRequires: python-six BuildRequires: python-tornado +BuildRequires: python-backports-ssl_match_hostname %if 0%{?with_python3} BuildRequires: python3-devel @@ -77,12 +77,7 @@ Python3 HTTP module with connection pooling and file POST abilities. %prep %setup -q -n %{srcname}-%{version} -### TODO: unbundle everything in packages/: -# Need: -# ssl_match_hostname https://bugzilla.redhat.com/show_bug.cgi?id=885013 -# rm -rf urllib3/packages/ -rm -rf urllib3/packages/six* -rm -rf urllib3/packages/ordered_dict* +rm -rf urllib3/packages/ %patch0 -p1 %patch1 -p1 @@ -144,6 +139,9 @@ popd %endif # with_python3 %changelog +* Fri Mar 1 2013 Toshio Kuratomi - 1.5-5 +- Unbundling finished! + * Fri Mar 01 2013 Ralph Bean - 1.5-4 - Upstream patch to fix Accept header when behind a proxy. - Reorganize patch numbers to more clearly distinguish them.