Closed GoogleCodeExporter closed 9 years ago
Duplicated with http://code.google.com/p/httplib2/issues/detail?id=62
Original comment by yaohua2...@gmail.com
on 14 May 2010 at 2:22
I don't know if this is the same bug, but this is the behavior I'm getting for
the
tip (changeset 144:68f69a80024e) of the default branch:
>>> from httplib2 import Http
>>> http = Http()
>>> http.request('http://127.0.0.1:5000') # nothing running at this URL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "httplib2/__init__.py", line 1135, in request
(response, content) = self._request(conn, authority, uri, request_uri, method,
body, headers, redirections, cachekey)
File "httplib2/__init__.py", line 907, in _request
(response, content) = self._conn_request(conn, request_uri, method, body,
headers)
File "httplib2/__init__.py", line 870, in _conn_request
if e.errno == errno.ECONNREFUSED: # Connection refused
AttributeError: 'error' object has no attribute 'errno'
What's more is that subsequent calls to the same address give the same error
reported
by issue #62. It doesn't seem to have been fixed.
>>> http.request('http://127.0.0.1:5000')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "httplib2/__init__.py", line 1135, in request
(response, content) = self._request(conn, authority, uri, request_uri, method,
body, headers, redirections, cachekey)
File "httplib2/__init__.py", line 907, in _request
(response, content) = self._conn_request(conn, request_uri, method, body,
headers)
File "httplib2/__init__.py", line 877, in _conn_request
response = conn.getresponse()
File "/usr/lib/python2.5/httplib.py", line 926, in getresponse
method=self._method)
File "/usr/lib/python2.5/httplib.py", line 324, in __init__
self.fp = sock.makefile('rb', 0)
AttributeError: 'NoneType' object has no attribute 'makefile'
>>> http.request('http://127.0.0.1:5000')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "httplib2/__init__.py", line 1135, in request
(response, content) = self._request(conn, authority, uri, request_uri, method,
body, headers, redirections, cachekey)
File "httplib2/__init__.py", line 907, in _request
(response, content) = self._conn_request(conn, request_uri, method, body,
headers)
File "httplib2/__init__.py", line 877, in _conn_request
response = conn.getresponse()
File "/usr/lib/python2.5/httplib.py", line 926, in getresponse
method=self._method)
File "/usr/lib/python2.5/httplib.py", line 324, in __init__
self.fp = sock.makefile('rb', 0)
AttributeError: 'NoneType' object has no attribute 'makefile'
An exception is to be expected for this behavior, but we're probably looking
for a
more specific one.
Original comment by fridrik...@ru.is
on 1 Jun 2010 at 1:38
This hack fixes it for me. I couldn't see any other way to determine if
conn.sock (from httplib) is None.
The httplib getresponse() call is unable to handle sock being None, and also
requires either close() or getresponse() to cleanup conn before it can ever be
used again.
Original comment by goo...@sa.me.uk
on 18 Dec 2010 at 5:09
Attachments:
This issue was closed by revision 0cff83696d.
Original comment by joe.gregorio@gmail.com
on 11 Feb 2011 at 5:29
Issue 102 has been merged into this issue.
Original comment by joe.gregorio@gmail.com
on 11 Feb 2011 at 6:07
Issue 105 has been merged into this issue.
Original comment by joe.gregorio@gmail.com
on 13 Feb 2011 at 3:46
Issue 101 has been merged into this issue.
Original comment by joe.gregorio@gmail.com
on 13 Feb 2011 at 3:47
Original issue reported on code.google.com by
matthew.schick
on 6 Apr 2010 at 10:11