Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Doc/library/urllib.request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ The :mod:`!urllib.request` module defines the following functions:

Raises :exc:`~urllib.error.URLError` on protocol errors.

Exceptions raised while reading or parsing an HTTP response are not
wrapped in :exc:`~urllib.error.URLError` and propagate unchanged.
These include subclasses of :exc:`http.client.HTTPException`, such as
:exc:`~http.client.BadStatusLine` for a malformed status line, and
subclasses of :exc:`OSError`, such as :exc:`TimeoutError` if the server
does not respond within *timeout* seconds, or
:exc:`~http.client.RemoteDisconnected` if the server closes the
connection without sending a response. :exc:`ValueError` is raised if
*url* is not a valid URL.

Note that ``None`` may be returned if no handler handles the request (though
the default installed global :class:`OpenerDirector` uses
:class:`UnknownHandler` to ensure this never happens).
Expand Down
Loading