summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-04-24 04:53:12 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-04-24 04:53:12 (GMT)
commit8eea9ac8891e88d5f063284f5d0119f50ebc0c0d (patch)
tree38e59d5e1158672765363e9b63f27aed3a787b33 /Doc
parentd0bfa7454169606cfc0881c22e55c623d80c016c (diff)
downloadcpython-8eea9ac8891e88d5f063284f5d0119f50ebc0c0d.zip
cpython-8eea9ac8891e88d5f063284f5d0119f50ebc0c0d.tar.gz
cpython-8eea9ac8891e88d5f063284f5d0119f50ebc0c0d.tar.bz2
Fix SF #1703110, Incorrect example for add_password() (use uri, not host)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/liburllib2.tex5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/lib/liburllib2.tex b/Doc/lib/liburllib2.tex
index ed3ab96..f6ff513 100644
--- a/Doc/lib/liburllib2.tex
+++ b/Doc/lib/liburllib2.tex
@@ -817,7 +817,10 @@ Use of Basic HTTP Authentication:
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)