Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b895505

Browse files
committed
whatsnew: HTTPError.headers (#15701).
1 parent 5253034 commit b895505

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/library/urllib.error.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
4848

4949
.. attribute:: headers
5050

51-
The HTTP response headers for the HTTP request that cause the
51+
The HTTP response headers for the HTTP request that caused the
5252
:exc:`HTTPError`.
5353

5454
.. versionadded:: 3.4

Doc/whatsnew/3.4.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,11 @@ headers from a :class:`~urllib.request.Request`. (Contributed by Alexey
16271627
Kachayev in :issue:`16464`, Daniel Wozniak in :issue:`17485`, and Damien Brecht
16281628
and Senthil Kumaran in :issue:`17272`.)
16291629

1630+
:class:`~urllib.error.HTTPError` objects now have a
1631+
:attr:`~urllib.error.HTTPError.headers` attribute that provides access to the
1632+
HTTP response headers associated with the error. (Contributed by
1633+
Berker Peksag in :issue:`15701`.)
1634+
16301635

16311636
unittest
16321637
--------

0 commit comments

Comments
 (0)