aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog9
-rw-r--r--debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch34
-rw-r--r--debian/patches/series1
3 files changed, 44 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 96b69e2..9d75aa9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+requests (2.4.3-3) unstable; 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 <eriol@mornie.org> 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 <jwilk@debian.org>
+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