Comment 6 for bug 361554

Revision history for this message
Rob Fisher (robfisher) wrote :

The bug is in /usr/lib/python2.6/dist-packages/UpdateManager/Core/utils.py . The url_downloadable function does not try to use the proxy.

The offending code is:
import urlparse
(scheme, netloc, path, querry, fragment) = urlparse.urlsplit(uri)
c = httplib.HTTPConnection(netloc)
c.request("HEAD", path)

It should connect to the proxy, not to the netloc part of the uri.

I used this workaround:

import urlparse
(scheme, netloc, path, querry, fragment) = urlparse.urlsplit(uri) # we still need scheme for later
proxy = os.getenv('http_proxy') # this has already been set by init_proxy
c = httplib.HTTPConnection(proxy) # connect to the proxy instead
c.request("HEAD", uri) # specify the whole URI here

It's a bit of a hack and won't work for ftp uris. I've never submitted an Ubuntu patch before so will have to learn how to do that before fixing it properly, unless someone else is inclined to.