This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Error in urllib2 example
Type: Stage:
Components: Documentation Versions: Python 2.7, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: dieresys, georg.brandl, orsenthil
Priority: normal Keywords: patch

Created on 2009-12-23 21:11 by dieresys, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib2.patch dieresys, 2009-12-23 21:11 Fix for Proxy Basic authentication example
Messages (2)
msg96843 - (view) Author: Manuel Muradás (dieresys) Date: 2009-12-23 21:11
We've found an error in an urllib2 example with Proxy Basic
authentication. This is the example with the error:
{{{
This example replaces the default ProxyHandler with one that uses
programmatically-supplied proxy URLs, and adds proxy authorization
support with ProxyBasicAuthHandler.

proxy_handler = urllib2.ProxyHandler({'http':
'http://www.example.com:3128/'})
proxy_auth_handler = urllib2.HTTPBasicAuthHandler()
proxy_auth_handler.add_password('realm', 'host', 'username', 'password')

opener = 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')
}}}

Attached you will find a patch with the fix.
msg96847 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2009-12-24 02:27
Fixed it in r77018 and merges.
History
Date User Action Args
2022-04-11 14:56:55adminsetgithub: 51819
2009-12-24 02:27:36orsenthilsetstatus: open -> closed
resolution: fixed
messages: + msg96847
2009-12-24 00:59:59orsenthilsetassignee: georg.brandl -> orsenthil

nosy: + orsenthil
2009-12-23 21:11:57dieresyscreate