Title: proxy_bypass in urllib handling of macro
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 2.7
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: atuining, orsenthil
Priority: normal Keywords: easy, patch

Created on 2007-01-30 18:14 by atuining, last changed 2009-05-01 06:03 by orsenthil. This issue is now closed.

File name Uploaded Description Edit atuining, 2007-01-30 18:14 Patch for
Messages (3)
msg51815 - (view) Author: Anthony Tuininga (atuining) * Date: 2007-01-30 18:14
We have discovered that the handling of the <local> macro in urllib.proxy_bypass is broken. According to the Microsoft documentation for this macro, what should be checked is simply that the host name specified does not contain a period. Since urllib gets its proxy information directly from the Windows registry it would make sense to use the same definitions that Microsoft does. Attached is a patch that does this.

Here is a link to the documentation that specifies this:

Note the section discussing the proxy bypass parameter.

In addition, this patch adds code to strip the entries in the proxy bypass settings of any leading and trailing spaces. Internet Explorer supports this although it does not appear to be officially documented.
msg51816 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2007-08-19 07:34
From the documentation:

    [in] A pointer to a string variable that contains an optional list of host names or IP addresses, or both, that should not be routed through the proxy when dwAccessType is set to WINHTTP_ACCESS_TYPE_NAMED_PROXY. The list can contain wildcard characters. Do not use an empty string, because the WinHttpOpen function uses it as the proxy bypass list. If this parameter specifies the "<local>" macro as the only entry, this function bypasses any host name that does not contain a period. If dwAccessType is not set to WINHTTP_ACCESS_TYPE_NAMED_PROXY, this parameter must be set to WINHTTP_NO_PROXY_BYPASS.

Yes,valid patch for
msg86864 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2009-05-01 06:03
I have fix this issue, in the revision 72155 for py2.7 and revision
72156 for py3k. 
Unfortunately, we have no tests for any proxy handling condition for
Windows and Darwin. This is a very specific case in the proxy handling;
thought let the fix be in (as per the MSDN spec), unittest coverage can
dealt separately.
Date User Action Args
2016-07-18 01:38:59martin.panterlinkissue8238 superseder
2009-05-01 06:03:38orsenthilsetstatus: open -> closed

stage: test needed -> resolved
messages: + msg86864
versions: + Python 3.1, Python 2.7, - Python 2.6
2009-04-22 14:26:23orsenthilsetassignee: orsenthil
2009-04-22 05:08:55ajaksu2setkeywords: + easy
2009-03-30 19:48:34ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, - Python 2.5
2007-01-30 18:14:06atuiningcreate