[Python-modules-team] Bug#712915: python-requests: adapters.py uses undefined name ProxyManager
Scott Moser
smoser at ubuntu.com
Thu Jun 20 19:34:33 UTC 2013
Package: python-requests
Version: 1.2.0-2
Severity: important
Dear Maintainer,
As first reported in Ubuntu bug 1187429 [1], requests is simply broken if
the user's environment contains 'http_proxy'. This fails recreates in both
python and python3.
[1] https://bugs.launchpad.net/ubuntu/+source/requests/+bug/1187429
$ echo "import sys, requests" > recreate.py
$ echo "print(requests.get(sys.argv[1]).status_code)" >> recreate.py
$ python recreate.py http://debian.org
$ env -u http_proxy python recreate.py
200
$ env http_proxy=http://example.com/ python recreate.py http://debian.org
Traceback (most recent call last):
File "recreate.py", line 2, in <module>
print(requests.get(sys.argv[1]).status_code)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 354, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 460, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 191, in send
conn = self.get_connection(request.url, proxies)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 140, in get_connection
conn = ProxyManager(self.poolmanager.connection_from_url(proxy))
NameError: global name 'ProxyManager' is not defined
This was upstream fixed at https://github.com/kennethreitz/requests/commit/5152c98223d46c76cb7e88cb833b0087daf83d54
reported at https://github.com/kennethreitz/requests/issues/1017 .
It seems as simple as adding ProxyManager to the imports in adapters.py
-- System Information:
Debian Release: wheezy/sid
APT prefers saucy-updates
APT policy: (500, 'saucy-updates'), (500, 'saucy-security'), (500, 'saucy'), (100, 'saucy-backports')
Architecture: amd64 (x86_64)
Kernel: Linux 3.8.0-21-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-requests depends on:
ii ca-certificates 20130610
ii python 2.7.5-1ubuntu1
ii python-chardet 2.0.1-2build1
ii python-urllib3 1.6-2
python-requests recommends no packages.
python-requests suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list