diff -r 0dd6ac8ea523 Lib/test/test_urllib.py --- a/Lib/test/test_urllib.py Mon Apr 25 00:12:32 2016 +0300 +++ b/Lib/test/test_urllib.py Wed Apr 27 10:15:48 2016 +0800 @@ -228,6 +228,7 @@ # List of no_proxies with space. self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com') self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com')) + self.assertTrue(urllib.request.proxy_bypass_environment('ANOTHERDOMAIN.COM')) class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): """Test urlopen() opening a fake http connection.""" diff -r 0dd6ac8ea523 Lib/urllib/request.py --- a/Lib/urllib/request.py Mon Apr 25 00:12:32 2016 +0300 +++ b/Lib/urllib/request.py Wed Apr 27 10:15:48 2016 +0800 @@ -2472,9 +2472,9 @@ if no_proxy == '*': return 1 # strip port off host - hostonly, port = splitport(host) + hostonly, port = splitport(host.lower()) # check if the host ends with any of the DNS suffixes - no_proxy_list = [proxy.strip() for proxy in no_proxy.split(',')] + no_proxy_list = [proxy.strip() for proxy in no_proxy.lower().split(',')] for name in no_proxy_list: if name and (hostonly.endswith(name) or host.endswith(name)): return 1