Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 132477 - urllib does not honor no_proxy environment variable
urllib does not honor no_proxy environment variable
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2004-09-13 16:58 EDT by Andy Grover
Modified: 2014-01-21 17:49 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-06 16:11:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andy Grover 2004-09-13 16:58:23 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Firefox/0.9.3

Description of problem:
python urllib (via yum 2.1.3-1) does not look for or honor the
no_proxy environment variable. Please reference this bug in python


(note: the attached patch appears to be gzipped twice, strange...)

I didn't know what the protocol was for merging patches not yet
applied upstream, but I wanted to report the issue...

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
From behind a firewall with a non-transparent proxy:

1. set http_proxy to whatever
2. set no_proxy to mydomain.com
3. have yum.conf point to a repo in mydomain.com
4. yum update

Actual Results:  we're hitting the proxy

Expected Results:  we shouldn't hit the proxy

Additional info:
Comment 1 Seth Vidal 2005-01-11 10:33:12 EST
in the newer yum's the proxy stuff _should_ work per-repository.

if you set the proxy info in the yum.conf or *.repo files and then
don't set it for the location where you don't want it, does it work?
Comment 2 Enrico Scholz 2005-01-11 10:47:45 EST
configuring it on a per-repository case is not a good solution.
Proxies are a system-wide but not application-specific setting (except
some special cases like anonymizing proxy in your browser, but this
does not matter here).

Most (mature) software understands and honors the $http_proxy +
$no_proxy environment variables for proxy setup (firefox/mozilla is
the only exception I know), and so, urllib should do it also.
Comment 3 Seth Vidal 2005-01-11 10:56:46 EST
I'm not arguging that urllib should not do it. I'm just explaining in
the case of yum the proxy stuff CAN be done per-repo.
Comment 4 Mihai Ibanescu 2005-04-20 15:49:13 EDT
The patch didn't make it into 2.4.1 either. I am hesitant to adding patches that
we would have to support ourselves, therefore I am closing the bug as WONTFIX.
But please do feel free to reopen it if you feel strongly about having this in,
even though I would recommend getting the patch merged upstream.
Comment 5 Enrico Scholz 2005-10-11 08:20:11 EDT
ok, reopening the bug as suggested ;)  

no_proxy support is elementarily for every HTTP aware application. The broken
urllib makes e.g. the nightly yum updates impossible because the *_proxy env is
set globally.
Comment 6 Jeremy Katz 2007-01-06 16:11:33 EST
Really needs to be applied upstream; we're already carrying way too many
non-upstreamed patches to python and I'm trying to get that number down.  Added
myself to the upstream bug to watch for it.  (Note that their concern afaict is
that it only fixes urllib and not urllib2 as well)

Note You need to log in before you can comment on or make changes to this bug.