Author stamparm
Recipients stamparm
Date 2013-04-26.12:27:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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 = LineAndFileWrapper(line, self.fp)").

In some cases readline() method requires a size argument (e.g. used with size argument inside HTTPMessage/readheaders(), HTTPResponse/begin(), HTTPResponse/_read_chunked, HTTPConnection/_tunnel, at least in "Python 2.7.1+ (r271:86832, Sep 27 2012, 21:12:17)").

This bug is hard to be reproduced as it requires a little help of "divine intervention".

One such exception looks like (reproduced on one user machine):
conn = urllib2.urlopen(req)
File "/usr/lib/python2.7/", line 127, in urlopen
return, data, timeout)
File "/usr/lib/python2.7/", line 401, in open
response = self._open(req, data)
File "/usr/lib/python2.7/", line 419, in _open
'_open', req)
File "/usr/lib/python2.7/", line 379, in _call_chain
result = func(*args)
File "/usr/share/sqlmap/lib/request/", line 64, in https_open
return self.do_open(HTTPSConnection if ssl else httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/", line 1178, in do_open
h.request(req.get_method(), req.get_selector(),, headers)
File "/usr/lib/python2.7/", line 962, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/", line 996, in _send_request
File "/usr/lib/python2.7/", line 958, in endheaders
File "/usr/lib/python2.7/", line 818, in _send_output
File "/usr/lib/python2.7/", line 780, in send
File "/usr/share/sqlmap/lib/request/", line 46, in connect
sock = create_sock()
File "/usr/share/sqlmap/lib/request/", line 39, in create_sock
File "/usr/lib/python2.7/", line 748, in _tunnel
line = response.fp.readline(_MAXLINE + 1)
TypeError: readline() takes exactly 1 argument (2 given)
Date User Action Args
2013-04-26 12:27:04stamparmsetrecipients: + stamparm
2013-04-26 12:27:04stamparmsetmessageid: <>
2013-04-26 12:27:04stamparmlinkissue17849 messages
2013-04-26 12:27:03stamparmcreate