From: Serhiy Storchaka Date: Sun, 13 Oct 2013 17:07:51 +0000 (+0300) Subject: Improve #19204: Improved cross-references in the urllib package documentation. X-Git-Tag: v3.4.0a4~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10e73babad7cd64192a563b67eaa11f73cd181de;p=thirdparty%2FPython%2Fcpython.git Improve #19204: Improved cross-references in the urllib package documentation. --- 10e73babad7cd64192a563b67eaa11f73cd181de diff --cc Doc/library/urllib.error.rst index 7bd04b1bc466,25c13bdc32e8..9fb58f508358 --- a/Doc/library/urllib.error.rst +++ b/Doc/library/urllib.error.rst @@@ -45,16 -46,10 +46,17 @@@ The following exceptions are raised by This is usually a string explaining the reason for this error. + .. attribute:: headers + + The HTTP response headers for the HTTP request that cause the + :exc:`HTTPError`. + + .. versionadded:: 3.4 + .. exception:: ContentTooShortError(msg, content) - This exception is raised when the :func:`urlretrieve` function detects that + This exception is raised when the :func:`~urllib.request.urlretrieve` + function detects that the amount of the downloaded data is less than the expected amount (given by the *Content-Length* header). The :attr:`content` attribute stores the downloaded (and supposedly truncated) data. diff --cc Doc/library/urllib.request.rst index ef902b1137b4,eac222f87bc4..61b773495512 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@@ -947,24 -980,9 +948,24 @@@ FileHandler Object .. versionchanged:: 3.2 This method is applicable only for local hostnames. When a remote - hostname is given, an :exc:`URLError` is raised. + hostname is given, an :exc:`~urllib.error.URLError` is raised. +.. _data-handler-objects: + +DataHandler Objects +------------------- + +.. method:: DataHandler.data_open(req) + + Read a data URL. This kind of URL contains the content encoded in the URL + itself. The data URL syntax is specified in :rfc:`2397`. This implementation + ignores white spaces in base64 encoded data URLs so the URL may be wrapped + in whatever source file it comes from. But even though some browsers don't + mind about a missing padding at the end of a base64 encoded data URL, this + implementation will raise an :exc:`ValueError` in that case. + + .. _ftp-handler-objects: FTPHandler Objects