Skip to content

Commit

Permalink
Clarify the units for timeouts within documentation (urllib3#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrant authored and sethmlarson committed Jun 4, 2019
1 parent 63d2ad4 commit 5af3728
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ to the standard-library :mod:`ssl` module. You may experience
Using timeouts
--------------

Timeouts allow you to control how long requests are allowed to run before
being aborted. In simple cases, you can specify a timeout as a ``float``
Timeouts allow you to control how long (in seconds) requests are allowed to run
before being aborted. In simple cases, you can specify a timeout as a ``float``
to :meth:`~poolmanager.PoolManager.request`::

>>> http.request(
Expand Down
17 changes: 9 additions & 8 deletions src/urllib3/util/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,20 @@ class Timeout(object):
:type total: integer, float, or None
:param connect:
The maximum amount of time to wait for a connection attempt to a server
to succeed. Omitting the parameter will default the connect timeout to
the system default, probably `the global default timeout in socket.py
The maximum amount of time (in seconds) to wait for a connection
attempt to a server to succeed. Omitting the parameter will default the
connect timeout to the system default, probably `the global default
timeout in socket.py
<http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`_.
None will set an infinite timeout for connection attempts.
:type connect: integer, float, or None
:param read:
The maximum amount of time to wait between consecutive
read operations for a response from the server. Omitting
the parameter will default the read timeout to the system
default, probably `the global default timeout in socket.py
The maximum amount of time (in seconds) to wait between consecutive
read operations for a response from the server. Omitting the parameter
will default the read timeout to the system default, probably `the
global default timeout in socket.py
<http://hg.python.org/cpython/file/603b4d593758/Lib/socket.py#l535>`_.
None will set an infinite timeout.
Expand Down Expand Up @@ -195,7 +196,7 @@ def start_connect(self):
def get_connect_duration(self):
""" Gets the time elapsed since the call to :meth:`start_connect`.
:return: Elapsed time.
:return: Elapsed time in seconds.
:rtype: float
:raises urllib3.exceptions.TimeoutStateError: if you attempt
to get duration for a timer that hasn't been started.
Expand Down

0 comments on commit 5af3728

Please sign in to comment.