<p dir="auto">I made a simple example script to showcase what I experienced</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import requests
import time

print('About to do a request that will timeout')
start_time = int(time.time())
try:
    response = requests.get('http://www.google.com:81/', timeout=4)
except requests.exceptions.RequestException as e:
    print(f'Exception: {str(e)}')
elapsed_secs = int(time.time()) - start_time
print(f'After request that should timeout. Elapsed seconds: {elapsed_secs}')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-k">import</span> <span class="pl-s1">time</span>

<span class="pl-en">print</span>(<span class="pl-s">'About to do a request that will timeout'</span>)
<span class="pl-s1">start_time</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-s1">time</span>.<span class="pl-en">time</span>())
<span class="pl-k">try</span>:
    <span class="pl-s1">response</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://www.google.com:81/'</span>, <span class="pl-s1">timeout</span><span class="pl-c1">=</span><span class="pl-c1">4</span>)
<span class="pl-k">except</span> <span class="pl-s1">requests</span>.<span class="pl-s1">exceptions</span>.<span class="pl-v">RequestException</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>:
    <span class="pl-en">print</span>(<span class="pl-s">f'Exception: <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-en">str</span>(<span class="pl-s1">e</span>)<span class="pl-kos">}</span></span>'</span>)
<span class="pl-s1">elapsed_secs</span> <span class="pl-c1">=</span> <span class="pl-en">int</span>(<span class="pl-s1">time</span>.<span class="pl-en">time</span>()) <span class="pl-c1">-</span> <span class="pl-s1">start_time</span>
<span class="pl-en">print</span>(<span class="pl-s">f'After request that should timeout. Elapsed seconds: <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">elapsed_secs</span><span class="pl-kos">}</span></span>'</span>)</pre></div>
<h2 dir="auto">Expected Result</h2>
<p dir="auto">I expected this to timeout after 4 seconds and per the given timeout.</p>
<h2 dir="auto">Actual Result</h2>
<p dir="auto">What happens instead is that the timeout exception is raised after 2x the given timeout argument.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="About to do a request that will timeout
Exception: HTTPConnectionPool(host='www.google.com', port=81): Max retries exceeded with url: / (Caused by ConnectTimeoutError(&lt;urllib3.connection.HTTPConnection object at 0x7f204f680550&gt;, 'Connection to www.google.com timed out. (connect timeout=4)'))
After request that should timeout. Elapsed seconds: 8"><pre class="notranslate"><code class="notranslate">About to do a request that will timeout
Exception: HTTPConnectionPool(host='www.google.com', port=81): Max retries exceeded with url: / (Caused by ConnectTimeoutError(&lt;urllib3.connection.HTTPConnection object at 0x7f204f680550&gt;, 'Connection to www.google.com timed out. (connect timeout=4)'))
After request that should timeout. Elapsed seconds: 8
</code></pre></div>
<h2 dir="auto">System Information</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python -m requests.help"><pre class="notranslate"><code class="notranslate">$ python -m requests.help
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;chardet&quot;: {
    &quot;version&quot;: &quot;4.0.0&quot;
  },
  &quot;cryptography&quot;: {
    &quot;version&quot;: &quot;&quot;
  },
  &quot;idna&quot;: {
    &quot;version&quot;: &quot;2.10&quot;
  },
  &quot;implementation&quot;: {
    &quot;name&quot;: &quot;CPython&quot;,
    &quot;version&quot;: &quot;3.7.9&quot;
  },
  &quot;platform&quot;: {
    &quot;release&quot;: &quot;5.10.16-arch1-1&quot;,
    &quot;system&quot;: &quot;Linux&quot;
  },
  &quot;pyOpenSSL&quot;: {
    &quot;openssl_version&quot;: &quot;&quot;,
    &quot;version&quot;: null
  },
  &quot;requests&quot;: {
    &quot;version&quot;: &quot;2.25.1&quot;
  },
  &quot;system_ssl&quot;: {
    &quot;version&quot;: &quot;101010af&quot;
  },
  &quot;urllib3&quot;: {
    &quot;version&quot;: &quot;1.26.3&quot;
  },
  &quot;using_pyopenssl&quot;: false
}
"><pre class="notranslate"><code class="notranslate">{
  "chardet": {
    "version": "4.0.0"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.10"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.7.9"
  },
  "platform": {
    "release": "5.10.16-arch1-1",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.25.1"
  },
  "system_ssl": {
    "version": "101010af"
  },
  "urllib3": {
    "version": "1.26.3"
  },
  "using_pyopenssl": false
}

</code></pre></div>
<p dir="auto">I wanted to install using pip and it gives me the following error:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PS C:\Users\bla&gt; pip install requests
Downloading/unpacking requests
  Real name of requirement requests is requests
  Downloading requests-0.14.2.tar.gz (361Kb): 361Kb downloaded
  Running setup.py egg_info for package requests
    Traceback (most recent call last):
      File &quot;&lt;string&gt;&quot;, line 14, in &lt;module&gt;
      File &quot;C:\Users\patrick\build\requests\setup.py&quot;, line 6, in &lt;module&gt;
        import requests
      File &quot;requests\__init__.py&quot;, line 52, in &lt;module&gt;
        from . import utils
      File &quot;requests\utils.py&quot;, line 22, in &lt;module&gt;
        from .compat import parse_http_list as _parse_list_header
      File &quot;requests\compat.py&quot;, line 112, in &lt;module&gt;
        from .packages import chardet2 as chardet
    ImportError: cannot import name chardet2
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File &quot;&lt;string&gt;&quot;, line 14, in &lt;module&gt;

  File &quot;C:\Users\patrick\build\requests\setup.py&quot;, line 6, in &lt;module&gt;

    import requests

  File &quot;requests\__init__.py&quot;, line 52, in &lt;module&gt;

    from . import utils

  File &quot;requests\utils.py&quot;, line 22, in &lt;module&gt;

    from .compat import parse_http_list as _parse_list_header

  File &quot;requests\compat.py&quot;, line 112, in &lt;module&gt;

    from .packages import chardet2 as chardet

ImportError: cannot import name chardet2

----------------------------------------
Command python setup.py egg_info failed with error code 1"><pre class="notranslate"><span class="pl-v">PS</span> <span class="pl-v">C</span>:\U<span class="pl-s1">sers</span>\b<span class="pl-s1">la</span><span class="pl-c1">&gt;</span> <span class="pl-s1">pip</span> <span class="pl-s1">install</span> <span class="pl-s1">requests</span>
<span class="pl-v">Downloading</span><span class="pl-c1">/</span><span class="pl-s1">unpacking</span> <span class="pl-s1">requests</span>
  <span class="pl-v">Real</span> <span class="pl-s1">name</span> <span class="pl-s1">of</span> <span class="pl-s1">requirement</span> <span class="pl-s1">requests</span> <span class="pl-c1">is</span> <span class="pl-s1">requests</span>
  <span class="pl-v">Downloading</span> <span class="pl-s1">requests</span><span class="pl-c1">-</span><span class="pl-c1">0.14</span>.<span class="pl-c1">2.</span><span class="pl-s1">tar</span>.<span class="pl-en">gz</span> (<span class="pl-c1">361</span><span class="pl-v">Kb</span>): <span class="pl-c1">361</span><span class="pl-v">Kb</span> <span class="pl-s1">downloaded</span>
  <span class="pl-v">Running</span> <span class="pl-s1">setup</span>.<span class="pl-s1">py</span> <span class="pl-s1">egg_info</span> <span class="pl-k">for</span> <span class="pl-s1">package</span> <span class="pl-s1">requests</span>
    <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):
      <span class="pl-v">File</span> <span class="pl-s">"&lt;string&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">14</span>, <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
      <span class="pl-v">File</span> <span class="pl-s">"C:\Users\patrick<span class="pl-cce">\b</span>uild<span class="pl-cce">\r</span>equests\setup.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">6</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
        <span class="pl-s1">import</span> <span class="pl-s1">requests</span>
      <span class="pl-v">File</span> <span class="pl-s">"requests\__init__.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">52</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
        <span class="pl-s1">from</span> . <span class="pl-s1">import</span> <span class="pl-s1">utils</span>
      <span class="pl-v">File</span> <span class="pl-s">"requests\utils.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">22</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
        <span class="pl-s1">from</span> .<span class="pl-s1">compat</span> <span class="pl-s1">import</span> <span class="pl-s1">parse_http_list</span> <span class="pl-k">as</span> <span class="pl-s1">_parse_list_header</span>
      <span class="pl-v">File</span> <span class="pl-s">"requests\compat.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">112</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>
        <span class="pl-s1">from</span> .<span class="pl-s1">packages</span> <span class="pl-s1">import</span> <span class="pl-s1">chardet2</span> <span class="pl-k">as</span> <span class="pl-s1">chardet</span>
    <span class="pl-v">ImportError</span>: <span class="pl-s1">cannot</span> <span class="pl-k">import</span> <span class="pl-s1">name</span> <span class="pl-s1">chardet2</span>
    <span class="pl-v">Complete</span> <span class="pl-s1">output</span> <span class="pl-k">from</span> <span class="pl-s1">command</span> <span class="pl-s1">python</span> <span class="pl-s1">setup</span>.<span class="pl-s1">py</span> <span class="pl-s1">egg_info</span>:
    <span class="pl-v">Traceback</span> (<span class="pl-s1">most</span> <span class="pl-s1">recent</span> <span class="pl-s1">call</span> <span class="pl-s1">last</span>):

  <span class="pl-v">File</span> <span class="pl-s">"&lt;string&gt;"</span>, <span class="pl-s1">line</span> <span class="pl-c1">14</span>, <span class="pl-c1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>

  <span class="pl-v">File</span> <span class="pl-s">"C:\Users\patrick<span class="pl-cce">\b</span>uild<span class="pl-cce">\r</span>equests\setup.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">6</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>

    <span class="pl-s1">import</span> <span class="pl-s1">requests</span>

  <span class="pl-v">File</span> <span class="pl-s">"requests\__init__.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">52</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>

    <span class="pl-s1">from</span> . <span class="pl-s1">import</span> <span class="pl-s1">utils</span>

  <span class="pl-v">File</span> <span class="pl-s">"requests\utils.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">22</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>

    <span class="pl-s1">from</span> .<span class="pl-s1">compat</span> <span class="pl-k">import</span> <span class="pl-s1">parse_http_list</span> <span class="pl-k">as</span> <span class="pl-s1">_parse_list_header</span>

  <span class="pl-v">File</span> <span class="pl-s">"requests\compat.py"</span>, <span class="pl-s1">line</span> <span class="pl-c1">112</span>, <span class="pl-s1">in</span> <span class="pl-c1">&lt;</span><span class="pl-s1">module</span><span class="pl-c1">&gt;</span>

    <span class="pl-s1">from</span> .<span class="pl-s1">packages</span> <span class="pl-k">import</span> <span class="pl-s1">chardet2</span> <span class="pl-k">as</span> <span class="pl-s1">chardet</span>

<span class="pl-v">ImportError</span>: <span class="pl-s1">cannot</span> <span class="pl-s1">import</span> <span class="pl-s1">name</span> <span class="pl-s1">chardet2</span>

<span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span><span class="pl-c1">-</span>
<span class="pl-v">Command</span> <span class="pl-s1">python</span> <span class="pl-s1">setup</span>.<span class="pl-s1">py</span> <span class="pl-s1">egg_info</span> <span class="pl-s1">failed</span> <span class="pl-s1">with</span> <span class="pl-s1">error</span> <span class="pl-s1">code</span> <span class="pl-c1">1</span></pre></div>
<p dir="auto">I can import chardet as chardet from the interpreter. importing chardet2 fails.<br>
i guess this is a dependency that wasn't properly updated.<br>
the python version is 3.2.2</p>