Bug 132477

Summary: urllib does not honor no_proxy environment variable
Product: [Fedora] Fedora Reporter: Andy Grover <andrew.grover>
Component: pythonAssignee: Jeremy Katz <katzj>
Status: CLOSED UPSTREAM QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: djuran, katzj, rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://sourceforge.net/tracker/index.php?func=detail&aid=856047&group_id=5470&atid=105470
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-01-06 21:11:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andy Grover 2004-09-13 20:58:23 UTC
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
bugtracker:

http://sourceforge.net/tracker/index.php?func=detail&aid=856047&group_id=5470&atid=105470

(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):
python-2.3.4-10

How reproducible:
Always

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 15:33:12 UTC
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 15:47:45 UTC
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 15:56:46 UTC
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 19:49:13 UTC
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 12:20:11 UTC
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 21:11:33 UTC
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)