From: Senthil Kumaran Date: Thu, 7 Feb 2013 08:49:12 +0000 (-0800) Subject: Fix Issue17069: Document getcode method in urllib.request.rst X-Git-Tag: v3.3.1rc1~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=599ac4ba2dd6af6549dcafe4d948595001dec2f5;p=python Fix Issue17069: Document getcode method in urllib.request.rst --- 599ac4ba2dd6af6549dcafe4d948595001dec2f5 diff --cc Doc/library/urllib.request.rst index 21255e531b,ff5dd62f7a..f7bd2cd141 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@@ -53,23 -53,23 +53,29 @@@ The :mod:`urllib.request` module define point to a directory of hashed certificate files. More information can be found in :meth:`ssl.SSLContext.load_verify_locations`. + The *cadefault* parameter specifies whether to fall back to loading a + default certificate store defined by the underlying OpenSSL library if the + *cafile* and *capath* parameters are omitted. This will only work on + some non-Windows platforms. + .. warning:: - If neither *cafile* nor *capath* is specified, an HTTPS request - will not do any verification of the server's certificate. + If neither *cafile* nor *capath* is specified, and *cadefault* is False, + an HTTPS request will not do any verification of the server's + certificate. - This function returns a file-like object that works as a :term:`context manager`, - with two additional methods from the :mod:`urllib.response` module + For http and https urls, this function returns a + :class:`http.client.HTTPResponse` object which has the following + :ref:`httpresponse-objects` methods. - * :meth:`geturl` --- return the URL of the resource retrieved, + For ftp, file, data urls and requests are explicity handled by legacy + :class:`URLopener` and :class:`FancyURLopener` class, this function returns + an :class:`urllib.response.addinfourl` 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, commonly used to determine if a redirect was followed - * :meth:`info` --- return the meta-information of the page, such as headers, + * :meth:`~urllib.response.addinfourl.info` --- return the meta-information of the page, such as headers, in the form of an :func:`email.message_from_string` instance (see `Quick Reference to HTTP Headers `_)