[Yum-devel] [PATCH] use proxy='' to disable default proxies

Zdeněk Pavlas zpavlas at redhat.com
Thu Apr 19 15:25:03 UTC 2012


Instead of ignoring proxy settings '_none_' or '',
use it to disable default proxies in libcurl.
---
 urlgrabber/grabber.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/urlgrabber/grabber.py b/urlgrabber/grabber.py
index c334242..38ae1f7 100644
--- a/urlgrabber/grabber.py
+++ b/urlgrabber/grabber.py
@@ -830,8 +830,9 @@ class URLGrabberOptions:
                     proxy = self.proxies.get('https')
                 elif scheme == 'https':
                     proxy = self.proxies.get('http')
-            if proxy != '_none_':
-                self.proxy = proxy
+            if proxy == '_none_':
+                proxy = ''
+            self.proxy = proxy
             return
 
         if self.libproxy:
@@ -1318,7 +1319,7 @@ class PyCurlFileObject(object):
             self.curl_obj.setopt(pycurl.MAX_RECV_SPEED_LARGE, int(opts.raw_throttle()))
             
         # proxy
-        if opts.proxy:
+        if opts.proxy is not None:
             self.curl_obj.setopt(pycurl.PROXY, opts.proxy)
             self.curl_obj.setopt(pycurl.PROXYAUTH, pycurl.HTTPAUTH_ANY)
 
-- 
1.7.4.4



More information about the Yum-devel mailing list