MCPcopy Create free account
hub / github.com/python/cpython / _proxy_bypass_winreg_override

Function _proxy_bypass_winreg_override

Lib/urllib/request.py:2012–2033  ·  view source on GitHub ↗

Return True if the host should bypass the proxy server. The proxy override list is obtained from the Windows Internet settings proxy override registry value. An example of a proxy override value is: "www.example.com;*.example.net; 192.168.0.1"

(host, override)

Source from the content-addressed store, hash-verified

2010
2011# Same as _proxy_bypass_macosx_sysconf, testable on all platforms
2012def _proxy_bypass_winreg_override(host, override):
2013 """Return True if the host should bypass the proxy server.
2014
2015 The proxy override list is obtained from the Windows
2016 Internet settings proxy override registry value.
2017
2018 An example of a proxy override value is:
2019 "www.example.com;*.example.net; 192.168.0.1"
2020 """
2021 from fnmatch import fnmatch
2022
2023 host, _ = _splitport(host)
2024 proxy_override = override.split(';')
2025 for test in proxy_override:
2026 test = test.strip()
2027 # "<local>" should bypass the proxy server for all intranet addresses
2028 if test == '<local>':
2029 if '.' not in host:
2030 return True
2031 elif fnmatch(host, test):
2032 return True
2033 return False
2034
2035
2036if sys.platform == 'darwin':

Callers 1

proxy_bypass_registryFunction · 0.85

Calls 4

_splitportFunction · 0.90
fnmatchFunction · 0.90
splitMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…