<p dir="auto">Steps to reproduce:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import socket
import requests

socket.setdefaultimeout(0.0001)
# Expected this to raise exception, but it does not.
requests.get('http://google.com')

# These 2 raise an exception
requests.get('http://google.com', timeout=socket.gettimeout())
requests.get('http://google.com', timeout=socket._GLOBAL_DEFAULT_TIMEOUT)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">socket</span>
<span class="pl-k">import</span> <span class="pl-s1">requests</span>

<span class="pl-s1">socket</span>.<span class="pl-en">setdefaultimeout</span>(<span class="pl-c1">0.0001</span>)
<span class="pl-c"># Expected this to raise exception, but it does not.</span>
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://google.com'</span>)

<span class="pl-c"># These 2 raise an exception</span>
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://google.com'</span>, <span class="pl-s1">timeout</span><span class="pl-c1">=</span><span class="pl-s1">socket</span>.<span class="pl-en">gettimeout</span>())
<span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://google.com'</span>, <span class="pl-s1">timeout</span><span class="pl-c1">=</span><span class="pl-s1">socket</span>.<span class="pl-s1">_GLOBAL_DEFAULT_TIMEOUT</span>)</pre></div>
<p dir="auto">Looks like the default "None" value is propagated to urllib3, which has <code class="notranslate">socket._GLOBAL_DEFAULT_TIMEOUT</code> set as the default timeout.</p>
<p dir="auto">Is this by-design or a bug?</p>
<p dir="auto">Thanks for an excellent package. I believe the quick start examples should include a timeout value. This is the more common case, rather than the exception.</p>
<p dir="auto">In the more advanced documentation it maybe wise to mention that sockets.getdefaulttimeout() is not used when a value is not specified.</p>