diff --git a/NEWS b/NEWS index fc662d8f..3b00dd9e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ * Use 'osc ls /' if you really want to list all projects. * This is meant as a proof of concept. I intend to generalize this usage of '.' for all osc commands. Feedback welcome. + - support http proxies when using python 2.6 or newer (#551004) # # Features which require OBS 1.7 # diff --git a/osc/conf.py b/osc/conf.py index 9269c6ac..f4644b0c 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -317,14 +317,13 @@ def init_basicauth(config): global cookiejar - # HTTPS proxy is not supported by urllib2. It only leads to an error - # or, at best, a warning. - # https://bugzilla.novell.com/show_bug.cgi?id=214983 - # https://bugzilla.novell.com/show_bug.cgi?id=298378 - if 'https_proxy' in os.environ: - del os.environ['https_proxy'] - if 'HTTPS_PROXY' in os.environ: - del os.environ['HTTPS_PROXY'] + if sys.version_info < (2, 6): + # HTTPS proxy is not supported in old urllib2. It only leads to an error + # or, at best, a warning. + if 'https_proxy' in os.environ: + del os.environ['https_proxy'] + if 'HTTPS_PROXY' in os.environ: + del os.environ['HTTPS_PROXY'] if config['http_debug']: # brute force