[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-06 Thread Martin Panter
Martin Panter added the comment: Thanks Cory. Error now looks like this: $ https_proxy=http://223.19.230.181:80 ./python -c 'from urllib2 import *; urlopen("https://bugs.python.org/issue17849";)' [. . .] urllib2.URLError: -- resolution: -> fixed stage: patch review -> resolved status

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3510e5d435db by Martin Panter in branch '2.7': Issue #17849: Raise sensible exception for invalid HTTP tunnel response https://hg.python.org/cpython/rev/3510e5d435db -- nosy: +python-dev ___ Python track

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-04 Thread Martin Panter
Martin Panter added the comment: Patch 3 looks better IMO. Now instead of the TypeError, we should see an error something like socket.error: Tunnel connection failed: 200 I’ll commit this in a day or so, perhaps with an improved error message, like “Invalid response from tunnel request”. ---

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-03 Thread Cory Benfield
Cory Benfield added the comment: Ok, version three of the patch is now available. -- Added file: http://bugs.python.org/file40345/readline_3.patch ___ Python tracker ___

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-03 Thread Cory Benfield
Cory Benfield added the comment: Martin, the idea of simply rejecting the LifeAndFileWrapper HTTP/0.9 fallback for _tunnel feels reasonable to me, that can work. Let me whip up an alternative patch that does that. -- ___ Python tracker

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-02 Thread Martin Panter
Martin Panter added the comment: I still don’t think the test case is a reasonable example. According to , HTTP 0.9 only supported GET, not CONNECT, and doesn’t include any header fields in the protocol (such as your X-Foo: bar). It would ma

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-02 Thread Cory Benfield
Cory Benfield added the comment: Ok, new patch now attached. -- Added file: http://bugs.python.org/file40328/readline_2.patch ___ Python tracker ___ _

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-02 Thread Cory Benfield
Cory Benfield added the comment: Martin: as noted in the comments on this issue, I believed the specific test case did not match any of the problems people were encountering: it was just the least bad way to trigger the specific flow that was being encountered. In practice for these issues it'

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Martin Panter
Martin Panter added the comment: A test case with data like this would make more sense to me: # Response without HTTP status line or header, modelling responses sent by # some proxies that do not support CONNECT body = b"400 Bad Request" -- ___ Pytho

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Martin Panter
Martin Panter added the comment: Left some review comments. But I don’t completely understand the test case. Is it true there are proxies that do not send a HTTP status line (like HTTP/1.0 200 Connection Established), but do sned the rest of the HTTP header section? This is what the test case

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Garfield222
Garfield222 added the comment: This error occurs when using youtube-dl Complete log is here: https://github.com/rg3/youtube-dl/issues/6727 -- ___ Python tracker ___

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-09-01 Thread Garfield222
Garfield222 added the comment: Same error happens if http_proxy="223.19.230.181:80" variable is set. -- nosy: +Garfield222 ___ Python tracker ___

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-05-13 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mail

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-05-12 Thread JitterMan
JitterMan added the comment: I ran into this problem when I gave https_proxy an invalid value: export https_proxy=http://foo.com No divine intervention required. I was just trying to determine what message was printed with the proxy environment variable was set incorrectly. Perhaps that w

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-05-12 Thread Demian Brecht
Changes by Demian Brecht : -- nosy: +demian.brecht ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2015-05-12 Thread R. David Murray
Changes by R. David Murray : -- nosy: +jitterman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-09-27 Thread R. David Murray
R. David Murray added the comment: I tried the patch, but the test fails for me: test test_httplib failed -- Traceback (most recent call last): File "/home/rdmurray/python/p27/Lib/test/test_httplib.py", line 434, in test_proxy_tunnel_without_status_line conn.set_tunnel('foo') File "/hom

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-06-30 Thread R. David Murray
Changes by R. David Murray : -- stage: needs patch -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-06-30 Thread Ian Cordasco
Changes by Ian Cordasco : -- nosy: +icordasc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-06-05 Thread Pierre Tardy
Pierre Tardy added the comment: I made a similar patch today to fix the same issue, and I confirm the problem and the correctness of the solution Please approve the patch and fix this bug. -- nosy: +Pierre.Tardy ___ Python tracker

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread Cory Benfield
Cory Benfield added the comment: Alright, here's a patch. I'm not ecstatic about this test: it's utterly contrived, but it also seems to be the least bad way to reproduce this bug. Let me know if you strongly object and I'll take another swing at it (it'll probably involve extending the FakeS

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread Cory Benfield
Cory Benfield added the comment: I've been messing around trying to write a test for this, and it looks like genuinely the only place this can be hit is in _tunnel(). None of the other readline() calls can be hit with the LineAndFileWrapper() wrapping the file descriptor. -- nosy: +Lu

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread R. David Murray
R. David Murray added the comment: Requests may well want to put a workaround in place. To fix it in 2.7, we need a patch that actually respects the size argument, and a unit test. -- ___ Python tracker _

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-01-17 Thread Steve
Steve added the comment: I just noticed that this is reporducible consistently with the python requests[1] module, if you route your request through a proxy. I was wondering whether I should report this as a 'requests' bug or would this be the right place to add a 'me too' ? Here's the reporducer

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-11-15 Thread Rob
Changes by Rob : -- nosy: +raymondr ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mai

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-05-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +orsenthil, pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-05-02 Thread Adam Brenecki
Changes by Adam Brenecki : -- nosy: +adambrenecki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-29 Thread Miroslav Stampar
Miroslav Stampar added the comment: This trivial "patch" solved the issue (reported back by user): def _(self, *args): return self._readline() httplib.LineAndFileWrapper._readline = httplib.LineAndFileWrapper.readline httplib.LineAndFileWrapper.readline = _ --

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 3.3 doesn't support HTTP/0.9 and doesn't have LineAndFileWrapper class. -- nosy: +christian.heimes, serhiy.storchaka versions: -Python 3.3, Python 3.4 ___ Python tracker

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread R. David Murray
R. David Murray added the comment: Thanks for the report. Looks like it is a fairly rare case, which I suppose is why it hasn't been reported before. If the "could be" turns out to be sufficient, that should be enough for someone to write a test for this. The patch itself should be even easi

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Miroslav Stampar
Miroslav Stampar added the comment: Mentioned "divine intervention" could be: 1) Argument strict should be set to 0/False when instantiating HTTPResponse 2) No status should be returned from the backend server (hence the "# assume it's a Simple-Response from an 0.9 server") 3) Any part of respo

[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2013-04-26 Thread Miroslav Stampar
New submission from Miroslav Stampar: httplib module's auxiliary class LineAndFileWrapper contains a readline() method having no arguments (than self). It's being used in code where commented with "assume it's a Simple-Response from an 0.9 server" as a wrapper for response stream ("self.fp = L