<p dir="auto">Trying to get <a href="https://github.com/kennethreitz/requests/blob/master/README.rst?raw=true">https://github.com/kennethreitz/requests/blob/master/README.rst?raw=true</a> fails. Getting <a href="https://github.com/kennethreitz/requests/raw/master/README.rst">https://github.com/kennethreitz/requests/raw/master/README.rst</a> (which the former redirects to) succeeds, so I think this has something to do with the handling the redirect.</p>
<p dir="auto">I'm not 100% sure this is an issue with requests (it's possible the server is misbehaving), but the same URL does work in the browser and in curl and wget.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python                                                                                                                                      bjwebb@winslow
Python 3.4.3 (default, Mar 25 2015, 17:13:50) 
[GCC 4.9.2 20150304 (prerelease)] on linux
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import requests
&gt;&gt;&gt; requests.__version__
'2.6.2'
&gt;&gt;&gt; r = requests.get('https://github.com/kennethreitz/requests/blob/master/README.rst?raw=true')
Traceback (most recent call last):
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 372, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 544, in urlopen
    body=body, headers=headers)
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 374, in _make_request
    httplib_response = conn.getresponse()
  File &quot;/usr/lib/python3.4/http/client.py&quot;, line 1162, in getresponse
    raise ResponseNotReady(self.__state)
http.client.ResponseNotReady: Request-sent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/usr/lib/python3.4/site-packages/requests/adapters.py&quot;, line 370, in send
    timeout=timeout
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 597, in urlopen
    _stacktrace=sys.exc_info()[2])
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py&quot;, line 245, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py&quot;, line 309, in reraise
    raise value.with_traceback(tb)
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 544, in urlopen
    body=body, headers=headers)
  File &quot;/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py&quot;, line 374, in _make_request
    httplib_response = conn.getresponse()
  File &quot;/usr/lib/python3.4/http/client.py&quot;, line 1162, in getresponse
    raise ResponseNotReady(self.__state)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ResponseNotReady('Request-sent',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/usr/lib/python3.4/site-packages/requests/api.py&quot;, line 68, in get
    return request('get', url, **kwargs)
  File &quot;/usr/lib/python3.4/site-packages/requests/api.py&quot;, line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File &quot;/usr/lib/python3.4/site-packages/requests/sessions.py&quot;, line 465, in request
    resp = self.send(prep, **send_kwargs)
  File &quot;/usr/lib/python3.4/site-packages/requests/sessions.py&quot;, line 594, in send
    history = [resp for resp in gen] if allow_redirects else []
  File &quot;/usr/lib/python3.4/site-packages/requests/sessions.py&quot;, line 594, in &lt;listcomp&gt;
    history = [resp for resp in gen] if allow_redirects else []
  File &quot;/usr/lib/python3.4/site-packages/requests/sessions.py&quot;, line 196, in resolve_redirects
    **adapter_kwargs
  File &quot;/usr/lib/python3.4/site-packages/requests/sessions.py&quot;, line 573, in send
    r = adapter.send(request, **kwargs)
  File &quot;/usr/lib/python3.4/site-packages/requests/adapters.py&quot;, line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady('Request-sent',))
&gt;&gt;&gt; "><pre class="notranslate"><code class="notranslate">$ python                                                                                                                                      bjwebb@winslow
Python 3.4.3 (default, Mar 25 2015, 17:13:50) 
[GCC 4.9.2 20150304 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import requests
&gt;&gt;&gt; requests.__version__
'2.6.2'
&gt;&gt;&gt; r = requests.get('https://github.com/kennethreitz/requests/blob/master/README.rst?raw=true')
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 372, in _make_request
    httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 374, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1162, in getresponse
    raise ResponseNotReady(self.__state)
http.client.ResponseNotReady: Request-sent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 597, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py", line 245, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py", line 309, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 374, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.4/http/client.py", line 1162, in getresponse
    raise ResponseNotReady(self.__state)
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ResponseNotReady('Request-sent',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/usr/lib/python3.4/site-packages/requests/api.py", line 68, in get
    return request('get', url, **kwargs)
  File "/usr/lib/python3.4/site-packages/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 594, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 594, in &lt;listcomp&gt;
    history = [resp for resp in gen] if allow_redirects else []
  File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 196, in resolve_redirects
    **adapter_kwargs
  File "/usr/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady('Request-sent',))
&gt;&gt;&gt; 
</code></pre></div>
<p dir="auto">Starting in 2.6.1 an exception is thrown if a connection with chunked transfer-encoding is reused. I suspect that the bug is in the bundled urllib3 which was upgraded from 1.10.2 to 1.10.3.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#!/usr/bin/env python
import requests
s = requests.Session()
r = s.get('http://httpbin.org/stream/1')
r.json()
r = s.get('http://httpbin.org/stream/1')
r.json()"><pre class="notranslate"><span class="pl-c">#!/usr/bin/env python</span>
<span class="pl-k">import</span> <span class="pl-s1">requests</span>
<span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-s1">requests</span>.<span class="pl-v">Session</span>()
<span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-s1">s</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://httpbin.org/stream/1'</span>)
<span class="pl-s1">r</span>.<span class="pl-en">json</span>()
<span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-s1">s</span>.<span class="pl-en">get</span>(<span class="pl-s">'http://httpbin.org/stream/1'</span>)
<span class="pl-s1">r</span>.<span class="pl-en">json</span>()</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./test.py
Traceback (most recent call last):
  File &quot;./test.py&quot;, line 10, in &lt;module&gt;
    r = s.get('http://httpbin.org/stream/1')
  File &quot;[...]/requests/requests/sessions.py&quot;, line 477, in get
    return self.request('GET', url, **kwargs)
  File &quot;[...]/requests/requests/sessions.py&quot;, line 465, in request
    resp = self.send(prep, **send_kwargs)
  File &quot;[...]/requests/requests/sessions.py&quot;, line 573, in send
    r = adapter.send(request, **kwargs)
  File &quot;[...]/requests/requests/adapters.py&quot;, line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady())"><pre class="notranslate"><code class="notranslate">$ ./test.py
Traceback (most recent call last):
  File "./test.py", line 10, in &lt;module&gt;
    r = s.get('http://httpbin.org/stream/1')
  File "[...]/requests/requests/sessions.py", line 477, in get
    return self.request('GET', url, **kwargs)
  File "[...]/requests/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "[...]/requests/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "[...]/requests/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ResponseNotReady())
</code></pre></div>