downloading through proxy not working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Buildout |
New
|
Undecided
|
Unassigned |
Bug Description
I'm working on a suse unix system, and I have an environment variable:
http_proxy=http://
When I do a python ./bootstrap, I get the following error:
Traceback (most recent call last):
File "/tmp/tmpXwJvtd
user_defaults, windows_restart, command)
File "/tmp/tmpXwJvtd
data[
File "/tmp/tmpXwJvtd
eresult = _open(base, extends.pop(0), seen, dl_options, override)
File "/tmp/tmpXwJvtd
eresult = _open(base, extends.pop(0), seen, dl_options, override)
File "/tmp/tmpXwJvtd
path, is_temp = download(filename)
File "/tmp/tmpXwJvtd
local_path, is_temp = self.download(url, md5sum, path)
File "/tmp/tmpXwJvtd
tmp_path, headers = urllib.
File "/usr/lib64/
return _urlopener.
File "/usr/lib64/
fp = self.open(url, data)
File "/usr/lib64/
return getattr(self, name)(url)
File "/usr/lib64/
h.endheaders()
File "/usr/lib64/
self.
File "/usr/lib64/
self.send(msg)
File "/usr/lib64/
self.connect()
File "/usr/lib64/
socket.
IOError: [Errno socket error] (-2, 'Name or service not known')
After a little debugging it seems that urllib.urlretrieve seems to be the culprit. It can't handle this kind of proxy setting. I have also tried this in a little standalone python script, and it has the same bad result.
urllib2 handles the proxy setting just fine. So if I change this line:
tmp_path, headers = urllib.
into this:
import urllib2
tmp_sock = urllib2.
tmp_file = open(tmp_path, 'w')
tmp_file.
tmp_file.close()
then all works fine.
Now this code might not be great, but is it possible that urllib2 will be used as a workaround for this proxy issue?
Cheers, Huub
This error is not detected in machines with python2.4.
The error is detected in zc.buildout 1.4.4 and 1.5.2 with python2.6.
When I use cntlm version 0.35 I dont't detect the problem, but when i use cntlm version > 0.9 the error occurs.
With ntlmaps it's working.
I did what is described above and it worked.
Clayton