bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)

This commit is contained in:
Zackery Spytz 2019-09-13 08:07:07 -06:00 committed by Stéphane Wirtel
parent 693aa80a43
commit b761e3aed1
3 changed files with 18 additions and 14 deletions

View file

@ -792,6 +792,7 @@ class ProxyHandler(BaseHandler):
assert hasattr(proxies, 'keys'), "proxies must be a mapping"
self.proxies = proxies
for type, url in proxies.items():
type = type.lower()
setattr(self, '%s_open' % type,
lambda r, proxy=url, type=type, meth=self.proxy_open:
meth(r, proxy, type))