[Python-checkins] r54933 - in python/branches/release25-maint: Doc/lib/liburllib2.tex Lib/urllib2.py
neal.norwitz
python-checkins at python.org
Tue Apr 24 06:54:28 CEST 2007
Author: neal.norwitz
Date: Tue Apr 24 06:54:24 2007
New Revision: 54933
Modified:
python/branches/release25-maint/Doc/lib/liburllib2.tex
python/branches/release25-maint/Lib/urllib2.py
Log:
Fix SF #1703110, Incorrect example for add_password() (use uri, not host)
Modified: python/branches/release25-maint/Doc/lib/liburllib2.tex
==============================================================================
--- python/branches/release25-maint/Doc/lib/liburllib2.tex (original)
+++ python/branches/release25-maint/Doc/lib/liburllib2.tex Tue Apr 24 06:54:24 2007
@@ -817,7 +817,10 @@
import urllib2
# Create an OpenerDirector with support for Basic HTTP Authentication...
auth_handler = urllib2.HTTPBasicAuthHandler()
-auth_handler.add_password('realm', 'host', 'username', 'password')
+auth_handler.add_password(realm='PDQ Application',
+ uri='https://mahler:8092/site-updates.py',
+ user='klem',
+ passwd='kadidd!ehopper')
opener = urllib2.build_opener(auth_handler)
# ...and install it globally so it can be used with urlopen.
urllib2.install_opener(opener)
Modified: python/branches/release25-maint/Lib/urllib2.py
==============================================================================
--- python/branches/release25-maint/Lib/urllib2.py (original)
+++ python/branches/release25-maint/Lib/urllib2.py Tue Apr 24 06:54:24 2007
@@ -55,7 +55,10 @@
# set up authentication info
authinfo = urllib2.HTTPBasicAuthHandler()
-authinfo.add_password('realm', 'host', 'username', 'password')
+authinfo.add_password(realm='PDQ Application',
+ uri='https://mahler:8092/site-updates.py',
+ user='klem',
+ passwd='geheim$parole')
proxy_support = urllib2.ProxyHandler({"http" : "http://ahad-haam:3128"})
More information about the Python-checkins
mailing list