From 85e86887091113799621f46c409db68b7dd2771b Mon Sep 17 00:00:00 2001 From: Daniele Tricoli Date: Tue, 11 Nov 2014 02:43:50 +0000 Subject: * debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch - Make Python import system know that requests.packages.urllib3 and urllib3 are the same thing. Thanks to Jakub Wilk for the patch. (Closes: #769047) --- debian/changelog | 9 ++++++ ...requests.packages.urllib3-same-as-urllib3.patch | 34 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 44 insertions(+) create mode 100644 debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch diff --git a/debian/changelog b/debian/changelog index 96b69e2..1320035 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +requests (2.4.3-3) UNRELEASED; urgency=medium + + * debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch + - Make Python import system know that requests.packages.urllib3 and + urllib3 are the same thing. Thanks to Jakub Wilk for the patch. + (Closes: #769047) + + -- Daniele Tricoli Tue, 11 Nov 2014 03:28:18 +0100 + requests (2.4.3-2) unstable; urgency=medium * debian/patches/03_export-IncompleteRead.patch diff --git a/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch b/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch new file mode 100644 index 0000000..e26d9ae --- /dev/null +++ b/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch @@ -0,0 +1,34 @@ +Description: Make Python import system know that requests.packages.urllib3 and +urllib3 are the same thing. +Author: Jakub Wilk +Forwarded: not-needed +Bug-Debian: https://bugs.debian.org/769047 +Last-Update: 2014-11-05 + +--- a/requests/__init__.py ++++ b/requests/__init__.py +@@ -48,6 +48,24 @@ + __license__ = 'Apache 2.0' + __copyright__ = 'Copyright 2014 Kenneth Reitz' + ++# On Debian make Python import system know that requests.packages.urllib3 ++# and urllib3 are the same thing. ++import pkgutil ++import sys ++import urllib3 ++ ++def _attach_namespace(package, where): ++ for loader, name, ispkg in pkgutil.walk_packages(package.__path__, ++ package.__name__ + '.'): ++ try: ++ module = __import__(name) ++ except ImportError: ++ continue ++ sys.modules[where + '.' + name] = module ++ ++_attach_namespace(urllib3, 'requests.packages') ++del _attach_namespace ++ + # Attempt to enable urllib3's SNI support, if possible + try: + from urllib3.contrib import pyopenssl diff --git a/debian/patches/series b/debian/patches/series index 0a8f016..38fffac 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 01_use-system-ca-certificates.patch 02_use-system-chardet-and-urllib3.patch 03_export-IncompleteRead.patch +04_make-requests.packages.urllib3-same-as-urllib3.patch -- cgit v1.2.3