diff -r 45707b4547ea Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst Thu Jun 02 16:44:10 2016 -0400 +++ b/Doc/library/urllib.request.rst Thu Jun 02 17:09:36 2016 -0700 @@ -83,7 +83,7 @@ :class:`URLopener` and :class:`FancyURLopener` classes, this function returns a :class:`urllib.response.addinfourl` object. - Raises :exc:`~urllib.error.URLError` on errors. + Raises :exc:`~urllib.error.URLError` on protocol errors. Note that ``None`` may be returned if no handler handles the request (though the default installed global :class:`OpenerDirector` uses diff -r 45707b4547ea Lib/urllib/request.py --- a/Lib/urllib/request.py Thu Jun 02 16:44:10 2016 -0400 +++ b/Lib/urllib/request.py Thu Jun 02 17:09:36 2016 -0700 @@ -173,12 +173,7 @@ The *cadefault* parameter is ignored. For http and https urls, this function returns a http.client.HTTPResponse - object which has the following HTTPResponse Objects methods. - - For ftp, file, and data urls and requests explicitly handled by legacy - URLopener and FancyURLopener classes, this function returns a - urllib.response.addinfourl object which can work as context manager and has - methods such as: + object which has the following HTTPResponse Objects methods: * geturl() - return the URL of the resource retrieved, commonly used to determine if a redirect was followed @@ -190,6 +185,11 @@ * getcode() - return the HTTP status code of the response. Raises URLError on errors. + For ftp, file, and data urls and requests explicitly handled by legacy + URLopener and FancyURLopener classes, this function returns a + urllib.response.addinfourl object which can work as context manager and + also support the geturl(), info(), getcode() methods listed above. + Note that *None& may be returned if no handler handles the request (though the default installed global OpenerDirector uses UnknownHandler to ensure this never happens).