diff options
author | Kurt B. Kaiser <kbk@shore.net> | 2004-07-11 02:13:17 (GMT) |
---|---|---|
committer | Kurt B. Kaiser <kbk@shore.net> | 2004-07-11 02:13:17 (GMT) |
commit | 8932b41669d7a17c3b3749a67e5778812559d8b4 (patch) | |
tree | 08e0b44ccf7e4dccd295d46d6f7e0e03ae5a0d6b /Doc/lib | |
parent | d2c5b4b549b24e637b16c60bdfae7292e1e75c06 (diff) | |
download | cpython-8932b41669d7a17c3b3749a67e5778812559d8b4.zip cpython-8932b41669d7a17c3b3749a67e5778812559d8b4.tar.gz cpython-8932b41669d7a17c3b3749a67e5778812559d8b4.tar.bz2 |
Patch 851752 (fixes bug 820583)
Patch by John J Lee
Reviewed by Jeff Epler / KBK
Doc built OK.
urlopen() may return None if no handler handles the request.
Also clarify what install_opener does.
M liburllib2.tex
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/liburllib2.tex | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/lib/liburllib2.tex b/Doc/lib/liburllib2.tex index 4003e3b..51a3655 100644 --- a/Doc/lib/liburllib2.tex +++ b/Doc/lib/liburllib2.tex @@ -33,12 +33,19 @@ This function returns a file-like object with two additional methods: \end{itemize} Raises \exception{URLError} on errors. + +Note that \code{None} may be returned if no handler handles the +request (though the default installed global \class{OpenerDirector} +uses \class{UnknownHandler} to ensure this never happens). \end{funcdesc} \begin{funcdesc}{install_opener}{opener} -Install an \class{OpenerDirector} instance as the default opener. -The code does not check for a real \class{OpenerDirector}, and any -class with the appropriate interface will work. +Install an \class{OpenerDirector} instance as the default global +opener. Installing an opener is only necessary if you want urlopen to +use that opener; otherwise, simply call \method{OpenerDirector.open()} +instead of \function{urlopen()}. The code does not check for a real +\class{OpenerDirector}, and any class with the appropriate interface +will work. \end{funcdesc} \begin{funcdesc}{build_opener}{\optional{handler, \moreargs}} |