[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Daniel Morrison

New submission from Daniel Morrison:

The no_proxy environment variable works in python as a case
sensitive suffix check.

Curl handles this variable as a case insensitive hostname check.

Case sensitivity appears to be in conflict with the DNS Case
Insensitivity RFC (https://tools.ietf.org/html/rfc4343).

While the suffix check is documented
(https://docs.python.org/3/library/urllib.request.html), this
seems to be problematic and inconsistent with other tools on the
system.

I believe the ideal solution would be to have proxy_bypass be a
method of ProxyHandler so that it can be overridden without
dependence on undocumented methods. This would also allow
for the requested behavior to be added without breaking backwards
compatibility.

--
components: Library (Lib)
messages: 264297
nosy: Daniel Morrison
priority: normal
severity: normal
status: open
title: urllib.request no_proxy check differs from curl
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 
<http://bugs.python.org/issue26864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Daniel Morrison

Daniel Morrison added the comment:

I believe there was a misunderstanding.

While the environment variable name is handled in a case
insensitive way, the contents of the environment variable is not.

Please see some examples below:

>>> os.environ['no_proxy'] = 'example.com'
>>> urllib.request.proxy_bypass('EXAMPLE.com')
0
>>> urllib.request.proxy_bypass('example.com')
1

Also to clarify the meaning of suffix check:

>>> os.environ['no_proxy'] = 'example.com'
>>> urllib.request.proxy_bypass('myexample.com')
1

My apologies for my lack of clarity.

--

___
Python tracker 
<http://bugs.python.org/issue26864>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com