diff -r c499cc2c4a06 Doc/library/urllib.request.rst --- a/Doc/library/urllib.request.rst Sat Aug 30 00:37:18 2014 +0200 +++ b/Doc/library/urllib.request.rst Thu Sep 11 08:25:17 2014 +0000 @@ -63,13 +63,7 @@ an HTTPS request will not do any verification of the server's certificate. - For http and https urls, this function returns a - :class:`http.client.HTTPResponse` object which has the following - :ref:`httpresponse-objects` methods. - - For ftp, file, and data urls and requests explicitly handled by legacy - :class:`URLopener` and :class:`FancyURLopener` classes, this function - returns a :class:`urllib.response.addinfourl` object which can work as + This function always returns an object which can work as :term:`context manager` and has methods such as * :meth:`~urllib.response.addinfourl.geturl` --- return the URL of the resource retrieved, @@ -80,6 +74,18 @@ `Quick Reference to HTTP Headers `_) * :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response. + + For http and https urls, this function returns a + :class:`http.client.HTTPResponse` object slightly modified. In addition to + the three new methods above, the msg attribute contains the same + information as the + :attr:`~http.client.HTTPResponse.reason` attribute --- the reason phrase + returned by server --- instead of the response headers as it is specified + in :class:`~http.client.HTTPResponse`'s documentation. + + For ftp, file, and data urls and requests explicitly handled by legacy + :class:`URLopener` and :class:`FancyURLopener` classes, this function + returns a :class:`urllib.response.addinfourl` object. Raises :exc:`~urllib.error.URLError` on errors.