diff options
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/01_do-not-use-embedded-python-six.patch | 168 | ||||
-rw-r--r-- | debian/patches/02_require-cert-verification.patch | 29 | ||||
-rw-r--r-- | debian/patches/03_force_setuptools.patch | 15 | ||||
-rw-r--r-- | debian/patches/04_relax_nosetests_options.patch | 20 | ||||
-rw-r--r-- | debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch | 56 | ||||
-rw-r--r-- | debian/patches/series | 5 |
6 files changed, 293 insertions, 0 deletions
diff --git a/debian/patches/01_do-not-use-embedded-python-six.patch b/debian/patches/01_do-not-use-embedded-python-six.patch new file mode 100644 index 0000000..a7a0716 --- /dev/null +++ b/debian/patches/01_do-not-use-embedded-python-six.patch @@ -0,0 +1,168 @@ +Description: Do not use embedded copy of python-six. +Author: Daniele Tricoli <eriol@mornie.org> +Forwarded: not-needed +Last-Update: 2014-09-23 + +--- a/test/test_collections.py ++++ b/test/test_collections.py +@@ -4,7 +4,7 @@ + HTTPHeaderDict, + RecentlyUsedContainer as Container + ) +-from urllib3.packages import six ++import six + xrange = six.moves.xrange + + +--- a/urllib3/connectionpool.py ++++ b/urllib3/connectionpool.py +@@ -27,7 +27,7 @@ + InsecureRequestWarning, + ) + from .packages.ssl_match_hostname import CertificateError +-from .packages import six ++import six + from .connection import ( + port_by_scheme, + DummyConnection, +--- a/urllib3/filepost.py ++++ b/urllib3/filepost.py +@@ -3,8 +3,8 @@ + from uuid import uuid4 + from io import BytesIO + +-from .packages import six +-from .packages.six import b ++import six ++from six import b + from .fields import RequestField + + writer = codecs.lookup('utf-8')[3] +--- a/urllib3/response.py ++++ b/urllib3/response.py +@@ -4,7 +4,7 @@ + + from ._collections import HTTPHeaderDict + from .exceptions import ProtocolError, DecodeError, ReadTimeoutError +-from .packages.six import string_types as basestring, binary_type ++from six import string_types as basestring, binary_type + from .connection import HTTPException, BaseSSLError + from .util.response import is_fp_closed + +--- a/test/test_filepost.py ++++ b/test/test_filepost.py +@@ -2,7 +2,7 @@ + + from urllib3.filepost import encode_multipart_formdata, iter_fields + from urllib3.fields import RequestField +-from urllib3.packages.six import b, u ++from six import b, u + + + BOUNDARY = '!! test boundary !!' +--- a/dummyserver/handlers.py ++++ b/dummyserver/handlers.py +@@ -211,7 +211,7 @@ + """ + import tornado.httputil + import email.utils +- from urllib3.packages import six ++ import six + if not six.PY3: + line = line.encode('utf-8') + parts = tornado.httputil._parseparam(';' + line) +--- a/urllib3/fields.py ++++ b/urllib3/fields.py +@@ -1,7 +1,7 @@ + import email.utils + import mimetypes + +-from .packages import six ++import six + + + def guess_content_type(filename, default='application/octet-stream'): +--- a/test/test_fields.py ++++ b/test/test_fields.py +@@ -1,7 +1,7 @@ + import unittest + + from urllib3.fields import guess_content_type, RequestField +-from urllib3.packages.six import u ++from six import u + + + class TestRequestField(unittest.TestCase): +--- a/urllib3/_collections.py ++++ b/urllib3/_collections.py +@@ -14,7 +14,7 @@ + from collections import OrderedDict + except ImportError: + from .packages.ordered_dict import OrderedDict +-from .packages.six import itervalues ++from six import itervalues + + + __all__ = ['RecentlyUsedContainer', 'HTTPHeaderDict'] +--- a/urllib3/connection.py ++++ b/urllib3/connection.py +@@ -3,7 +3,7 @@ + import socket + from socket import timeout as SocketTimeout + import warnings +-from .packages import six ++import six + + try: # Python 3 + from http.client import HTTPConnection as _HTTPConnection, HTTPException +--- a/urllib3/util/request.py ++++ b/urllib3/util/request.py +@@ -1,6 +1,6 @@ + from base64 import b64encode + +-from ..packages.six import b ++from six import b + + ACCEPT_ENCODING = 'gzip,deflate' + +--- a/urllib3/util/retry.py ++++ b/urllib3/util/retry.py +@@ -7,7 +7,7 @@ + ReadTimeoutError, + MaxRetryError, + ) +-from ..packages import six ++import six + + + log = logging.getLogger(__name__) +--- a/test/test_retry.py ++++ b/test/test_retry.py +@@ -1,6 +1,6 @@ + import unittest + +-from urllib3.packages.six.moves import xrange ++from six.moves import xrange + from urllib3.util.retry import Retry + from urllib3.exceptions import ( + ConnectTimeoutError, +--- a/test/__init__.py ++++ b/test/__init__.py +@@ -7,7 +7,7 @@ + from nose.plugins.skip import SkipTest + + from urllib3.exceptions import MaxRetryError, HTTPWarning +-from urllib3.packages import six ++import six + + # We need a host that will not immediately close the connection with a TCP + # Reset. SO suggests this hostname +--- a/test/contrib/test_pyopenssl.py ++++ b/test/contrib/test_pyopenssl.py +@@ -1,5 +1,5 @@ + from nose.plugins.skip import SkipTest +-from urllib3.packages import six ++import six + + if six.PY3: + raise SkipTest('Testing of PyOpenSSL disabled on PY3') diff --git a/debian/patches/02_require-cert-verification.patch b/debian/patches/02_require-cert-verification.patch new file mode 100644 index 0000000..1b5992c --- /dev/null +++ b/debian/patches/02_require-cert-verification.patch @@ -0,0 +1,29 @@ +Author: Jamie Strandboge <jamie@canonical.com> +Description: require SSL certificate validation by default by using + CERT_REQUIRED and using the system /etc/ssl/certs/ca-certificates.crt +Bug-Ubuntu: https://launchpad.net/bugs/1047054 +Bug-Debian: http://bugs.debian.org/686872 +Last-Update: 2014-09-01 + +--- a/urllib3/connectionpool.py ++++ b/urllib3/connectionpool.py +@@ -628,6 +628,8 @@ + ``ssl_version`` are only used if :mod:`ssl` is available and are fed into + :meth:`urllib3.util.ssl_wrap_socket` to upgrade the connection socket + into an SSL socket. ++ ++ On Debian, SSL certificate validation is required by default + """ + + scheme = 'https' +@@ -637,8 +639,8 @@ + strict=False, timeout=Timeout.DEFAULT_TIMEOUT, maxsize=1, + block=False, headers=None, retries=None, + _proxy=None, _proxy_headers=None, +- key_file=None, cert_file=None, cert_reqs=None, +- ca_certs=None, ssl_version=None, ++ key_file=None, cert_file=None, cert_reqs='CERT_REQUIRED', ++ ca_certs='/etc/ssl/certs/ca-certificates.crt', ssl_version=None, + assert_hostname=None, assert_fingerprint=None, + **conn_kw): + diff --git a/debian/patches/03_force_setuptools.patch b/debian/patches/03_force_setuptools.patch new file mode 100644 index 0000000..e829b50 --- /dev/null +++ b/debian/patches/03_force_setuptools.patch @@ -0,0 +1,15 @@ +Author: Barry Warsaw <barry@debian.org> +Description: Use setuptools.setup() so that the bdist_wheel + command will work. +Last-Update: 2014-05-15 + +--- a/setup.py ++++ b/setup.py +@@ -1,6 +1,6 @@ + #!/usr/bin/env python + +-from distutils.core import setup ++from setuptools import setup + + import os + import re diff --git a/debian/patches/04_relax_nosetests_options.patch b/debian/patches/04_relax_nosetests_options.patch new file mode 100644 index 0000000..2f7f8ff --- /dev/null +++ b/debian/patches/04_relax_nosetests_options.patch @@ -0,0 +1,20 @@ +Description: Do not use logging-clear-handlers to see all logging output and + disable cover-min-percentage since it require python-nose (>= 1.3): this way + it will be easier to backport python-urllib3 to Wheezy. +Author: Daniele Tricoli <eriol@mornie.org> +Forwarded: not-needed +Last-Update: 2014-7-7 + +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,8 +1,8 @@ + [nosetests] +-logging-clear-handlers = true ++# logging-clear-handlers = true + with-coverage = true + cover-package = urllib3 +-cover-min-percentage = 100 ++# cover-min-percentage = 100 + cover-erase = true + + [flake8] diff --git a/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch b/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch new file mode 100644 index 0000000..b58f31d --- /dev/null +++ b/debian/patches/05_do-not-use-embedded-ssl-match-hostname.patch @@ -0,0 +1,56 @@ +Description: Do not use embedded copy of ssl.match_hostname. +Author: Daniele Tricoli <eriol@mornie.org> +Forwarded: not-needed +Last-Update: 2014-09-23 + +--- a/test/test_connectionpool.py ++++ b/test/test_connectionpool.py +@@ -6,7 +6,7 @@ + HTTPConnectionPool, + ) + from urllib3.util.timeout import Timeout +-from urllib3.packages.ssl_match_hostname import CertificateError ++from ssl import CertificateError + from urllib3.exceptions import ( + ClosedPoolError, + EmptyPoolError, +--- a/urllib3/connection.py ++++ b/urllib3/connection.py +@@ -39,7 +39,7 @@ + ConnectTimeoutError, + SystemTimeWarning, + ) +-from .packages.ssl_match_hostname import match_hostname ++from ssl import match_hostname + + from .util.ssl_ import ( + resolve_cert_reqs, +--- a/urllib3/connectionpool.py ++++ b/urllib3/connectionpool.py +@@ -26,7 +26,7 @@ + TimeoutError, + InsecureRequestWarning, + ) +-from .packages.ssl_match_hostname import CertificateError ++from ssl import CertificateError + import six + from .connection import ( + port_by_scheme, +--- a/urllib3/packages/__init__.py ++++ b/urllib3/packages/__init__.py +@@ -1,4 +1,3 @@ + from __future__ import absolute_import + +-from . import ssl_match_hostname + +--- a/setup.py ++++ b/setup.py +@@ -42,7 +42,7 @@ + url='http://urllib3.readthedocs.org/', + license='MIT', + packages=['urllib3', +- 'urllib3.packages', 'urllib3.packages.ssl_match_hostname', ++ 'urllib3.packages', + 'urllib3.contrib', 'urllib3.util', + ], + requires=[], diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..cddf757 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,5 @@ +01_do-not-use-embedded-python-six.patch +02_require-cert-verification.patch +03_force_setuptools.patch +04_relax_nosetests_options.patch +05_do-not-use-embedded-ssl-match-hostname.patch |