mirror of https://github.com/python/cpython
Merged revisions 77018 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77018 | senthil.kumaran | 2009-12-24 07:48:14 +0530 (Thu, 24 Dec 2009) | 3 lines Fix for Issue7570: Error in urllib2 example. ........
This commit is contained in:
parent
17e1c12787
commit
a1e845084f
|
@ -945,10 +945,10 @@ programmatically-supplied proxy URLs, and adds proxy authorization support with
|
|||
:class:`ProxyBasicAuthHandler`. ::
|
||||
|
||||
proxy_handler = urllib2.ProxyHandler({'http': 'http://www.example.com:3128/'})
|
||||
proxy_auth_handler = urllib2.HTTPBasicAuthHandler()
|
||||
proxy_auth_handler = urllib2.ProxyBasicAuthHandler()
|
||||
proxy_auth_handler.add_password('realm', 'host', 'username', 'password')
|
||||
|
||||
opener = build_opener(proxy_handler, proxy_auth_handler)
|
||||
opener = urllib2.build_opener(proxy_handler, proxy_auth_handler)
|
||||
# This time, rather than install the OpenerDirector, we use it directly:
|
||||
opener.open('http://www.example.com/login.html')
|
||||
|
||||
|
|
Loading…
Reference in New Issue