We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Interrupted system call while profiling with plop
Using Python 2.7.12, requests 2.19.0, urllib3 1.23 and using [plop](https://github.com/bdarnell/plop) for profiling, I'm intermittently hitting this stack trace in long-running code:
```
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py", line 525, in get
    return self.request('GET', url, **kwargs)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/home/bmerry/work/sdp/git/katdal/katdal/chunkstore_s3.py", line 56, in send
    return super(_TimeoutHTTPAdapter, self).send(request, stream, timeout, *args, **kwargs)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 588, in urlopen
    conn = self._get_conn(timeout=pool_timeout)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/connectionpool.py", line 239, in _get_conn
    if conn and is_connection_dropped(conn):
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/connection.py", line 23, in is_connection_dropped
    return wait_for_read(sock, timeout=0.0)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py", line 146, in wait_for_read
    return wait_for_socket(sock, read=True, timeout=timeout)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py", line 107, in poll_wait_for_socket
    return bool(_retry_on_intr(do_poll, timeout))
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py", line 47, in _retry_on_intr
    return fn(timeout)
  File "/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py", line 105, in do_poll
    return poll_obj.poll(t)
select.error: (4, 'Interrupted system call')
Profiling timer expired
```

Looking at the implementation of `_retry_on_intr` for older Pythons, it has this special case:
```python
        if timeout is not None and timeout <= 0:
            return fn(timeout)
```
which in turn seems to apply to the call stack above (see is_connection_dropped, which passes a timeout of 0.0). So apparently there are cases where poll can fail with EINTR even with a zero timeout. FWIW, I'm running Ubuntu 16.04 and Linux 4.4.0-116-generic. I'll try commenting out that fast path and doing some testing overnight to confirm that that is the problem.

I don't yet had a minimal reproducible example, but I'll work on it (my first attempt of just banging on some URL in a loop hasn't worked). I wanted to file this before I forgot.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `urllib3/util/wait.py`
Content:
```
1 import errno
2 from functools import partial
3 import select
4 import sys
5 try:
6     from time import monotonic
7 except ImportError:
8     from time import time as monotonic
9 
10 __all__ = ["NoWayToWaitForSocketError", "wait_for_read", "wait_for_write"]
11 
12 
13 class NoWayToWaitForSocketError(Exception):
14     pass
15 
16 
17 # How should we wait on sockets?
18 #
19 # There are two types of APIs you can use for waiting on sockets: the fancy
20 # modern stateful APIs like epoll/kqueue, and the older stateless APIs like
21 # select/poll. The stateful APIs are more efficient when you have a lots of
22 # sockets to keep track of, because you can set them up once and then use them
23 # lots of times. But we only ever want to wait on a single socket at a time
24 # and don't want to keep track of state, so the stateless APIs are actually
25 # more efficient. So we want to use select() or poll().
26 #
27 # Now, how do we choose between select() and poll()? On traditional Unixes,
28 # select() has a strange calling convention that makes it slow, or fail
29 # altogether, for high-numbered file descriptors. The point of poll() is to fix
30 # that, so on Unixes, we prefer poll().
31 #
32 # On Windows, there is no poll() (or at least Python doesn't provide a wrapper
33 # for it), but that's OK, because on Windows, select() doesn't have this
34 # strange calling convention; plain select() works fine.
35 #
36 # So: on Windows we use select(), and everywhere else we use poll(). We also
37 # fall back to select() in case poll() is somehow broken or missing.
38 
39 if sys.version_info >= (3, 5):
40     # Modern Python, that retries syscalls by default
41     def _retry_on_intr(fn, timeout):
42         return fn(timeout)
43 else:
44     # Old and broken Pythons.
45     def _retry_on_intr(fn, timeout):
46         if timeout is not None and timeout <= 0:
47             return fn(timeout)
48 
49         if timeout is None:
50             deadline = float("inf")
51         else:
52             deadline = monotonic() + timeout
53 
54         while True:
55             try:
56                 return fn(timeout)
57             # OSError for 3 <= pyver < 3.5, select.error for pyver <= 2.7
58             except (OSError, select.error) as e:
59                 # 'e.args[0]' incantation works for both OSError and select.error
60                 if e.args[0] != errno.EINTR:
61                     raise
62                 else:
63                     timeout = deadline - monotonic()
64                     if timeout < 0:
65                         timeout = 0
66                     if timeout == float("inf"):
67                         timeout = None
68                     continue
69 
70 
71 def select_wait_for_socket(sock, read=False, write=False, timeout=None):
72     if not read and not write:
73         raise RuntimeError("must specify at least one of read=True, write=True")
74     rcheck = []
75     wcheck = []
76     if read:
77         rcheck.append(sock)
78     if write:
79         wcheck.append(sock)
80     # When doing a non-blocking connect, most systems signal success by
81     # marking the socket writable. Windows, though, signals success by marked
82     # it as "exceptional". We paper over the difference by checking the write
83     # sockets for both conditions. (The stdlib selectors module does the same
84     # thing.)
85     fn = partial(select.select, rcheck, wcheck, wcheck)
86     rready, wready, xready = _retry_on_intr(fn, timeout)
87     return bool(rready or wready or xready)
88 
89 
90 def poll_wait_for_socket(sock, read=False, write=False, timeout=None):
91     if not read and not write:
92         raise RuntimeError("must specify at least one of read=True, write=True")
93     mask = 0
94     if read:
95         mask |= select.POLLIN
96     if write:
97         mask |= select.POLLOUT
98     poll_obj = select.poll()
99     poll_obj.register(sock, mask)
100 
101     # For some reason, poll() takes timeout in milliseconds
102     def do_poll(t):
103         if t is not None:
104             t *= 1000
105         return poll_obj.poll(t)
106 
107     return bool(_retry_on_intr(do_poll, timeout))
108 
109 
110 def null_wait_for_socket(*args, **kwargs):
111     raise NoWayToWaitForSocketError("no select-equivalent available")
112 
113 
114 def _have_working_poll():
115     # Apparently some systems have a select.poll that fails as soon as you try
116     # to use it, either due to strange configuration or broken monkeypatching
117     # from libraries like eventlet/greenlet.
118     try:
119         poll_obj = select.poll()
120         poll_obj.poll(0)
121     except (AttributeError, OSError):
122         return False
123     else:
124         return True
125 
126 
127 def wait_for_socket(*args, **kwargs):
128     # We delay choosing which implementation to use until the first time we're
129     # called. We could do it at import time, but then we might make the wrong
130     # decision if someone goes wild with monkeypatching select.poll after
131     # we're imported.
132     global wait_for_socket
133     if _have_working_poll():
134         wait_for_socket = poll_wait_for_socket
135     elif hasattr(select, "select"):
136         wait_for_socket = select_wait_for_socket
137     else:  # Platform-specific: Appengine.
138         wait_for_socket = null_wait_for_socket
139     return wait_for_socket(*args, **kwargs)
140 
141 
142 def wait_for_read(sock, timeout=None):
143     """ Waits for reading to be available on a given socket.
144     Returns True if the socket is readable, or False if the timeout expired.
145     """
146     return wait_for_socket(sock, read=True, timeout=timeout)
147 
148 
149 def wait_for_write(sock, timeout=None):
150     """ Waits for writing to be available on a given socket.
151     Returns True if the socket is readable, or False if the timeout expired.
152     """
153     return wait_for_socket(sock, write=True, timeout=timeout)
154
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/urllib3/util/wait.py b/urllib3/util/wait.py
--- a/urllib3/util/wait.py
+++ b/urllib3/util/wait.py
@@ -43,9 +43,6 @@
 else:
     # Old and broken Pythons.
     def _retry_on_intr(fn, timeout):
-        if timeout is not None and timeout <= 0:
-            return fn(timeout)
-
         if timeout is None:
             deadline = float("inf")
         else:
@@ -117,7 +114,7 @@
     # from libraries like eventlet/greenlet.
     try:
         poll_obj = select.poll()
-        poll_obj.poll(0)
+        _retry_on_intr(poll_obj.poll, 0)
     except (AttributeError, OSError):
         return False
     else:

{"golden_diff": "diff --git a/urllib3/util/wait.py b/urllib3/util/wait.py\n--- a/urllib3/util/wait.py\n+++ b/urllib3/util/wait.py\n@@ -43,9 +43,6 @@\n else:\n     # Old and broken Pythons.\n     def _retry_on_intr(fn, timeout):\n-        if timeout is not None and timeout <= 0:\n-            return fn(timeout)\n-\n         if timeout is None:\n             deadline = float(\"inf\")\n         else:\n@@ -117,7 +114,7 @@\n     # from libraries like eventlet/greenlet.\n     try:\n         poll_obj = select.poll()\n-        poll_obj.poll(0)\n+        _retry_on_intr(poll_obj.poll, 0)\n     except (AttributeError, OSError):\n         return False\n     else:\n", "issue": "Interrupted system call while profiling with plop\nUsing Python 2.7.12, requests 2.19.0, urllib3 1.23 and using [plop](https://github.com/bdarnell/plop) for profiling, I'm intermittently hitting this stack trace in long-running code:\r\n```\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py\", line 525, in get\r\n    return self.request('GET', url, **kwargs)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py\", line 512, in request\r\n    resp = self.send(prep, **send_kwargs)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/sessions.py\", line 622, in send\r\n    r = adapter.send(request, **kwargs)\r\n  File \"/home/bmerry/work/sdp/git/katdal/katdal/chunkstore_s3.py\", line 56, in send\r\n    return super(_TimeoutHTTPAdapter, self).send(request, stream, timeout, *args, **kwargs)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/requests/adapters.py\", line 445, in send\r\n    timeout=timeout\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/connectionpool.py\", line 588, in urlopen\r\n    conn = self._get_conn(timeout=pool_timeout)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/connectionpool.py\", line 239, in _get_conn\r\n    if conn and is_connection_dropped(conn):\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/connection.py\", line 23, in is_connection_dropped\r\n    return wait_for_read(sock, timeout=0.0)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py\", line 146, in wait_for_read\r\n    return wait_for_socket(sock, read=True, timeout=timeout)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py\", line 107, in poll_wait_for_socket\r\n    return bool(_retry_on_intr(do_poll, timeout))\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py\", line 47, in _retry_on_intr\r\n    return fn(timeout)\r\n  File \"/home/bmerry/work/sdp/env/local/lib/python2.7/site-packages/urllib3/util/wait.py\", line 105, in do_poll\r\n    return poll_obj.poll(t)\r\nselect.error: (4, 'Interrupted system call')\r\nProfiling timer expired\r\n```\r\n\r\nLooking at the implementation of `_retry_on_intr` for older Pythons, it has this special case:\r\n```python\r\n        if timeout is not None and timeout <= 0:\r\n            return fn(timeout)\r\n```\r\nwhich in turn seems to apply to the call stack above (see is_connection_dropped, which passes a timeout of 0.0). So apparently there are cases where poll can fail with EINTR even with a zero timeout. FWIW, I'm running Ubuntu 16.04 and Linux 4.4.0-116-generic. I'll try commenting out that fast path and doing some testing overnight to confirm that that is the problem.\r\n\r\nI don't yet had a minimal reproducible example, but I'll work on it (my first attempt of just banging on some URL in a loop hasn't worked). I wanted to file this before I forgot.\n", "before_files": [{"content": "import errno\nfrom functools import partial\nimport select\nimport sys\ntry:\n    from time import monotonic\nexcept ImportError:\n    from time import time as monotonic\n\n__all__ = [\"NoWayToWaitForSocketError\", \"wait_for_read\", \"wait_for_write\"]\n\n\nclass NoWayToWaitForSocketError(Exception):\n    pass\n\n\n# How should we wait on sockets?\n#\n# There are two types of APIs you can use for waiting on sockets: the fancy\n# modern stateful APIs like epoll/kqueue, and the older stateless APIs like\n# select/poll. The stateful APIs are more efficient when you have a lots of\n# sockets to keep track of, because you can set them up once and then use them\n# lots of times. But we only ever want to wait on a single socket at a time\n# and don't want to keep track of state, so the stateless APIs are actually\n# more efficient. So we want to use select() or poll().\n#\n# Now, how do we choose between select() and poll()? On traditional Unixes,\n# select() has a strange calling convention that makes it slow, or fail\n# altogether, for high-numbered file descriptors. The point of poll() is to fix\n# that, so on Unixes, we prefer poll().\n#\n# On Windows, there is no poll() (or at least Python doesn't provide a wrapper\n# for it), but that's OK, because on Windows, select() doesn't have this\n# strange calling convention; plain select() works fine.\n#\n# So: on Windows we use select(), and everywhere else we use poll(). We also\n# fall back to select() in case poll() is somehow broken or missing.\n\nif sys.version_info >= (3, 5):\n    # Modern Python, that retries syscalls by default\n    def _retry_on_intr(fn, timeout):\n        return fn(timeout)\nelse:\n    # Old and broken Pythons.\n    def _retry_on_intr(fn, timeout):\n        if timeout is not None and timeout <= 0:\n            return fn(timeout)\n\n        if timeout is None:\n            deadline = float(\"inf\")\n        else:\n            deadline = monotonic() + timeout\n\n        while True:\n            try:\n                return fn(timeout)\n            # OSError for 3 <= pyver < 3.5, select.error for pyver <= 2.7\n            except (OSError, select.error) as e:\n                # 'e.args[0]' incantation works for both OSError and select.error\n                if e.args[0] != errno.EINTR:\n                    raise\n                else:\n                    timeout = deadline - monotonic()\n                    if timeout < 0:\n                        timeout = 0\n                    if timeout == float(\"inf\"):\n                        timeout = None\n                    continue\n\n\ndef select_wait_for_socket(sock, read=False, write=False, timeout=None):\n    if not read and not write:\n        raise RuntimeError(\"must specify at least one of read=True, write=True\")\n    rcheck = []\n    wcheck = []\n    if read:\n        rcheck.append(sock)\n    if write:\n        wcheck.append(sock)\n    # When doing a non-blocking connect, most systems signal success by\n    # marking the socket writable. Windows, though, signals success by marked\n    # it as \"exceptional\". We paper over the difference by checking the write\n    # sockets for both conditions. (The stdlib selectors module does the same\n    # thing.)\n    fn = partial(select.select, rcheck, wcheck, wcheck)\n    rready, wready, xready = _retry_on_intr(fn, timeout)\n    return bool(rready or wready or xready)\n\n\ndef poll_wait_for_socket(sock, read=False, write=False, timeout=None):\n    if not read and not write:\n        raise RuntimeError(\"must specify at least one of read=True, write=True\")\n    mask = 0\n    if read:\n        mask |= select.POLLIN\n    if write:\n        mask |= select.POLLOUT\n    poll_obj = select.poll()\n    poll_obj.register(sock, mask)\n\n    # For some reason, poll() takes timeout in milliseconds\n    def do_poll(t):\n        if t is not None:\n            t *= 1000\n        return poll_obj.poll(t)\n\n    return bool(_retry_on_intr(do_poll, timeout))\n\n\ndef null_wait_for_socket(*args, **kwargs):\n    raise NoWayToWaitForSocketError(\"no select-equivalent available\")\n\n\ndef _have_working_poll():\n    # Apparently some systems have a select.poll that fails as soon as you try\n    # to use it, either due to strange configuration or broken monkeypatching\n    # from libraries like eventlet/greenlet.\n    try:\n        poll_obj = select.poll()\n        poll_obj.poll(0)\n    except (AttributeError, OSError):\n        return False\n    else:\n        return True\n\n\ndef wait_for_socket(*args, **kwargs):\n    # We delay choosing which implementation to use until the first time we're\n    # called. We could do it at import time, but then we might make the wrong\n    # decision if someone goes wild with monkeypatching select.poll after\n    # we're imported.\n    global wait_for_socket\n    if _have_working_poll():\n        wait_for_socket = poll_wait_for_socket\n    elif hasattr(select, \"select\"):\n        wait_for_socket = select_wait_for_socket\n    else:  # Platform-specific: Appengine.\n        wait_for_socket = null_wait_for_socket\n    return wait_for_socket(*args, **kwargs)\n\n\ndef wait_for_read(sock, timeout=None):\n    \"\"\" Waits for reading to be available on a given socket.\n    Returns True if the socket is readable, or False if the timeout expired.\n    \"\"\"\n    return wait_for_socket(sock, read=True, timeout=timeout)\n\n\ndef wait_for_write(sock, timeout=None):\n    \"\"\" Waits for writing to be available on a given socket.\n    Returns True if the socket is readable, or False if the timeout expired.\n    \"\"\"\n    return wait_for_socket(sock, write=True, timeout=timeout)\n", "path": "urllib3/util/wait.py"}], "after_files": [{"content": "import errno\nfrom functools import partial\nimport select\nimport sys\ntry:\n    from time import monotonic\nexcept ImportError:\n    from time import time as monotonic\n\n__all__ = [\"NoWayToWaitForSocketError\", \"wait_for_read\", \"wait_for_write\"]\n\n\nclass NoWayToWaitForSocketError(Exception):\n    pass\n\n\n# How should we wait on sockets?\n#\n# There are two types of APIs you can use for waiting on sockets: the fancy\n# modern stateful APIs like epoll/kqueue, and the older stateless APIs like\n# select/poll. The stateful APIs are more efficient when you have a lots of\n# sockets to keep track of, because you can set them up once and then use them\n# lots of times. But we only ever want to wait on a single socket at a time\n# and don't want to keep track of state, so the stateless APIs are actually\n# more efficient. So we want to use select() or poll().\n#\n# Now, how do we choose between select() and poll()? On traditional Unixes,\n# select() has a strange calling convention that makes it slow, or fail\n# altogether, for high-numbered file descriptors. The point of poll() is to fix\n# that, so on Unixes, we prefer poll().\n#\n# On Windows, there is no poll() (or at least Python doesn't provide a wrapper\n# for it), but that's OK, because on Windows, select() doesn't have this\n# strange calling convention; plain select() works fine.\n#\n# So: on Windows we use select(), and everywhere else we use poll(). We also\n# fall back to select() in case poll() is somehow broken or missing.\n\nif sys.version_info >= (3, 5):\n    # Modern Python, that retries syscalls by default\n    def _retry_on_intr(fn, timeout):\n        return fn(timeout)\nelse:\n    # Old and broken Pythons.\n    def _retry_on_intr(fn, timeout):\n        if timeout is None:\n            deadline = float(\"inf\")\n        else:\n            deadline = monotonic() + timeout\n\n        while True:\n            try:\n                return fn(timeout)\n            # OSError for 3 <= pyver < 3.5, select.error for pyver <= 2.7\n            except (OSError, select.error) as e:\n                # 'e.args[0]' incantation works for both OSError and select.error\n                if e.args[0] != errno.EINTR:\n                    raise\n                else:\n                    timeout = deadline - monotonic()\n                    if timeout < 0:\n                        timeout = 0\n                    if timeout == float(\"inf\"):\n                        timeout = None\n                    continue\n\n\ndef select_wait_for_socket(sock, read=False, write=False, timeout=None):\n    if not read and not write:\n        raise RuntimeError(\"must specify at least one of read=True, write=True\")\n    rcheck = []\n    wcheck = []\n    if read:\n        rcheck.append(sock)\n    if write:\n        wcheck.append(sock)\n    # When doing a non-blocking connect, most systems signal success by\n    # marking the socket writable. Windows, though, signals success by marked\n    # it as \"exceptional\". We paper over the difference by checking the write\n    # sockets for both conditions. (The stdlib selectors module does the same\n    # thing.)\n    fn = partial(select.select, rcheck, wcheck, wcheck)\n    rready, wready, xready = _retry_on_intr(fn, timeout)\n    return bool(rready or wready or xready)\n\n\ndef poll_wait_for_socket(sock, read=False, write=False, timeout=None):\n    if not read and not write:\n        raise RuntimeError(\"must specify at least one of read=True, write=True\")\n    mask = 0\n    if read:\n        mask |= select.POLLIN\n    if write:\n        mask |= select.POLLOUT\n    poll_obj = select.poll()\n    poll_obj.register(sock, mask)\n\n    # For some reason, poll() takes timeout in milliseconds\n    def do_poll(t):\n        if t is not None:\n            t *= 1000\n        return poll_obj.poll(t)\n\n    return bool(_retry_on_intr(do_poll, timeout))\n\n\ndef null_wait_for_socket(*args, **kwargs):\n    raise NoWayToWaitForSocketError(\"no select-equivalent available\")\n\n\ndef _have_working_poll():\n    # Apparently some systems have a select.poll that fails as soon as you try\n    # to use it, either due to strange configuration or broken monkeypatching\n    # from libraries like eventlet/greenlet.\n    try:\n        poll_obj = select.poll()\n        _retry_on_intr(poll_obj.poll, 0)\n    except (AttributeError, OSError):\n        return False\n    else:\n        return True\n\n\ndef wait_for_socket(*args, **kwargs):\n    # We delay choosing which implementation to use until the first time we're\n    # called. We could do it at import time, but then we might make the wrong\n    # decision if someone goes wild with monkeypatching select.poll after\n    # we're imported.\n    global wait_for_socket\n    if _have_working_poll():\n        wait_for_socket = poll_wait_for_socket\n    elif hasattr(select, \"select\"):\n        wait_for_socket = select_wait_for_socket\n    else:  # Platform-specific: Appengine.\n        wait_for_socket = null_wait_for_socket\n    return wait_for_socket(*args, **kwargs)\n\n\ndef wait_for_read(sock, timeout=None):\n    \"\"\" Waits for reading to be available on a given socket.\n    Returns True if the socket is readable, or False if the timeout expired.\n    \"\"\"\n    return wait_for_socket(sock, read=True, timeout=timeout)\n\n\ndef wait_for_write(sock, timeout=None):\n    \"\"\" Waits for writing to be available on a given socket.\n    Returns True if the socket is readable, or False if the timeout expired.\n    \"\"\"\n    return wait_for_socket(sock, write=True, timeout=timeout)\n", "path": "urllib3/util/wait.py"}]}