This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: proxy_bypass in urllib handling of macro
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 2.7
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib.py.diff atuining, 2007-01-30 18:14 Patch for urllib.py
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:

http://msdn2.microsoft.com/en-gb/library/aa384098.aspx

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:

pwszProxyBypass
    [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 urllib.py.
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.
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44522
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