whatsnew: HTTPError.headers (#15701).

This commit is contained in:
R David Murray 2014-03-13 11:33:29 -04:00
parent 5253034c78
commit b895505625
2 changed files with 6 additions and 1 deletions

View File

@ -48,7 +48,7 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
.. attribute:: headers
The HTTP response headers for the HTTP request that cause the
The HTTP response headers for the HTTP request that caused the
:exc:`HTTPError`.
.. versionadded:: 3.4

View File

@ -1627,6 +1627,11 @@ headers from a :class:`~urllib.request.Request`. (Contributed by Alexey
Kachayev in :issue:`16464`, Daniel Wozniak in :issue:`17485`, and Damien Brecht
and Senthil Kumaran in :issue:`17272`.)
:class:`~urllib.error.HTTPError` objects now have a
:attr:`~urllib.error.HTTPError.headers` attribute that provides access to the
HTTP response headers associated with the error. (Contributed by
Berker Peksag in :issue:`15701`.)
unittest
--------