Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Keep-alive broken in 2.6.1 and 2.6.2 with chunked transfer-encoding #2568

Closed
lmikkelsen opened this Issue Apr 24, 2015 · 8 comments

Comments

Projects
None yet
6 participants

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.

#!/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()
$ ./test.py
Traceback (most recent call last):
  File "./test.py", line 10, in <module>
    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())
Owner

Lukasa commented Apr 24, 2015

I suspect that the bug is in the bundled urllib3 which was upgraded from 1.10.2 to 1.10.3.

As do I: can you open this bug over there, please? We'll fix it in that repository.

Owner

sigmavirus24 commented Apr 27, 2015

We should start preparing requests 2.7.0 with the fix for shazow/urllib3#598

Is there any workaround for this? I've gone back to 2.6.0 for now.

Owner

Lukasa commented Apr 28, 2015

@rfortress I'm afraid not. We're working on this, there are a number of other problems with the chunked change and we'd like to land them at all once if we possibly can.

I'm genuinely sorry for how long this is taking. =(

ne0ark commented Apr 29, 2015

Version 2.5.1 is latest version now? Isn't this version affected by: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=2015-2296

The latest and affected by the bug in question, is 2.6.2. The latest that is not affected by the bug in question, seems to be 2.6.0 -- and it works well for me.

@sigmavirus24 sigmavirus24 modified the milestone: 2.7.0 Apr 29, 2015

Owner

Lukasa commented Apr 29, 2015

Correct, 2.6.0 is the version to use to avoid this bug.

@chrippa chrippa referenced this issue in chrippa/livestreamer Apr 29, 2015

Open

Broken Filmon plugin #873

davehunt added a commit to davehunt/pytest-mozwebqa that referenced this issue May 1, 2015

@davehunt davehunt referenced this issue in mozilla/pytest-mozwebqa May 1, 2015

Merged

Pin requests to 2.6.0 to avoid keep-alive issue #150

elliottyates added a commit to penzance/canvas_python_sdk that referenced this issue May 1, 2015

locks requests library at 2.6.0 to cooperate with co-dependencies tha…
…t are affected by bug when making multiple calls using the same session (requests/requests#2568)
Owner

Lukasa commented May 3, 2015

I have just cut requests 2.7.0, which I believe resolves this problem (and several related ones). Thank you all for your patience!

@Lukasa Lukasa closed this May 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment