[issue26864] urllib.request no_proxy check differs from curl

2016-04-30 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26864] urllib.request no_proxy check differs from curl

2016-04-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset ca882ee68d46 by Martin Panter in branch '3.5': Issue #26864: Fix case insensitivity and suffix comparison with no_proxy https://hg.python.org/cpython/rev/ca882ee68d46 New changeset 1ceb91974dc4 by Martin Panter in branch 'default': Issue #26864:

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Martin Panter
Martin Panter added the comment: This version looks okay to me, thanks. -- ___ Python tracker ___ ___

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your comment martin. Using re.escape is really a good advise. -- Added file: http://bugs.python.org/file42627/issue26864_v5.patch ___ Python tracker

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: Update to improve the test case. -- Added file: http://bugs.python.org/file42625/issue26864_v4.patch ___ Python tracker

[issue26864] urllib.request no_proxy check differs from curl

2016-04-27 Thread Xiang Zhang
Xiang Zhang added the comment: I update the patch to use regular expression to handle both case and suffix. This regular expression has the function of curl's check_noproxy. And I think a separate test case is better here. -- Added file:

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang
Xiang Zhang added the comment: Yes, you are right. I don't notice that. I will try to fix it. -- ___ Python tracker ___

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Martin Panter
Martin Panter added the comment: I think this patch looks okay. It fixes the case insensitivity problem, but there is also the string suffix problem (see the myexample.com demo). I think it is reasonable for example.com to match my.example.com, but not myexample.com. -- stage: ->

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang
Xiang Zhang added the comment: The code has changed recently. I update the patch to reveal the change. -- Added file: http://bugs.python.org/file42622/issue26864_v2.patch ___ Python tracker

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang
Xiang Zhang added the comment: I write a patch to fix this. It seems on Windows and MacOS the behaviour is right. On MacOS it leaves the matching to fnmatch. On Windows it uses case insensitive regular matching. -- keywords: +patch Added file:

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, it's my fault to misunderstand. I think your thinking is reasonable. Curl handles the suffix check insensitively. -- components: +Library (Lib) -Documentation nosy: -docs@python type: enhancement -> behavior ___

[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' >>>

[issue26864] urllib.request no_proxy check differs from curl

2016-04-26 Thread Xiang Zhang
Xiang Zhang added the comment: No, urllib.request does not handle the no_proxy environment in case-sensitive way. It first checks if any environment_variable.lower() ends with "_proxy", and then checks if there is any environment_variable ends with "_proxy". So it works as a case insensitive

[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