of :exc:`IOError`.
-.. exception:: HTTPError
+.. exception:: HTTPError(url, code, msg, hdrs, fp)
Though being an exception (a subclass of :exc:`URLError`), an
:exc:`HTTPError` can also function as a non-exceptional file-like return
is useful when handling exotic HTTP errors, such as requests for
authentication.
+ .. attribute:: url
+
+ Contains the request URL.
+ An alias for *filename* attribute.
+
.. attribute:: code
An HTTP status code as defined in :rfc:`2616`. This numeric value corresponds
.. attribute:: reason
This is usually a string explaining the reason for this error.
+ An alias for *msg* attribute.
.. attribute:: headers
The HTTP response headers for the HTTP request that caused the
:exc:`HTTPError`.
+ An alias for *hdrs* attribute.
.. versionadded:: 3.4
+ .. attribute:: fp
+
+ A file-like object where the HTTP error body can be read from.
+
.. exception:: ContentTooShortError(msg, content)
This exception is raised when the :func:`~urllib.request.urlretrieve`