[Python-modules-team] Bug#766419: python3-requests: Version 2.4 of python-requests / python3-requests breaks virtualenv.

Daniele Tricoli eriol at mornie.org
Thu Oct 23 00:46:18 UTC 2014


Hello Nicolas,
thanks for the report!

On Thursday 23 October 2014 00:47:56 Nicolas CANIART wrote:
> The new version of python3-requests/python-requests (2.4.3) breaks
> pip which in turn breaks virtualenv (see bug #766261).

Yes, discovered myself, unfortunately!

> The request.compat module used to export a IncompleteRead
> module which virtualenv uses. But this symbol is no longer defined there
> and thus any package relying on it is prone to break.
> 
> Temporarily removing this package from unstable or uploading a version
> of the package that is patched so it exports the symbol in question
> again, seems advisable considering the amount of reverse dependency
> this package has (a quick grep in /usr/lib/python3/dist-package show
> no other package on my system but I have only a few of those reverse
> dependencies installed).

I prefer to patch requests, because I want 2.4.3-1 in Jessie.

Fortunally, accordingly to codesearch.d.n:
    
    http://codesearch.debian.net/search?prev=&q=filetype%3Apython+from+requests.compat+import&skip=0

few packages use requests.compat.

python-pip seems to be the only package to break since the only difference 
between v2.3.0 and v2.4.3 is:

$ git diff v2.3.0 v2.4.3 requests/compat.py
diff --git a/requests/compat.py b/requests/compat.py
index bdf10d6..be5a1ed 100644
--- a/requests/compat.py
+++ b/requests/compat.py
@@ -75,7 +75,9 @@ is_solaris = ('solar==' in str(sys.platform).lower())   # 
Complete guess.

 try:
     import simplejson as json
-except ImportError:
+except (ImportError, SyntaxError):
+    # simplejson does not support Python 3.2, it thows a SyntaxError
+    # because of u'...' Unicode literals.
     import json

 # ---------
@@ -90,7 +92,6 @@ if is_py2:
     from Cookie import Morsel
     from StringIO import StringIO
     from .packages.urllib3.packages.ordered_dict import OrderedDict
-    from httplib import IncompleteRead

     builtin_str = str
     bytes = str
@@ -106,7 +107,6 @@ elif is_py3:
     from http.cookies import Morsel
     from io import StringIO
     from collections import OrderedDict
-    from http.client import IncompleteRead

     builtin_str = str
     str = str

So I'm going to patch requests to export IncompleteRead form the httplib 
module (httplib is a module of the Python standard library so it will be a 
trivial patch) both for Python 2 and Python 3.

> Looking at pip source code on [1], it seems this symbol is no longer
> used so you may also want to coordinate with the pip maintainer
> (there are no newer release of pip, as of today).

Well, I will fix on requests side just know, since the freeze is around the 
corner, but I'm not contrary on coordinate with the pip maintainer! ;)
I will also add to my workflow testing pip after running requests' tests: they 
need Internet connection so I run them manually.

Cheers,

-- 
 Daniele Tricoli 'Eriol'
 http://mornie.org



More information about the Python-modules-team mailing list