]> granicus.if.org Git - python/commitdiff
Fix Issue17069: Document getcode method in urllib.request.rst
authorSenthil Kumaran <senthil@uthcode.com>
Thu, 7 Feb 2013 08:49:12 +0000 (00:49 -0800)
committerSenthil Kumaran <senthil@uthcode.com>
Thu, 7 Feb 2013 08:49:12 +0000 (00:49 -0800)
1  2 
Doc/library/urllib.request.rst

index 21255e531b44a9905ffd7bee4b316fe91b00ece0,ff5dd62f7acfb96b56689634331ddbcbd2e9c69e..f7bd2cd141313c8180ce00475fa389a1fcaff55b
@@@ -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 <http://www.cs.tut.fi/~jkorpela/http.html>`_)