Issue 140 in httplib2: AttributeError when server is unreachable

3 views
Skip to first unread message

codesite...@google.com

unread,
Apr 4, 2011, 4:58:52 PM4/4/11
to httplib...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 140 by jaracosan: AttributeError when server is unreachable
http://code.google.com/p/httplib2/issues/detail?id=140

What steps will reproduce the problem?

PS C:\Users\jaraco\projects\G\gryphon> python
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import httplib2
>>> h = httplib2.Http()
>>> h.request('http://www.jaraco.com:81')

What is the expected output? What do you see instead?

I expect to see some error about failing to establish a connection.
Instead, I get an AttributeError

Traceback (most recent call last):
File "<stdin>", line 1, in <module>

File "c:\python\lib\site-packages\httplib2-0.6.0-py2.7.egg\httplib2\__init__.py",
line 1129, in request
(response, content) = self._request(conn, authority, uri, request_uri,
method, body, headers, redirections, cachekey)

File "c:\python\lib\site-packages\httplib2-0.6.0-py2.7.egg\httplib2\__init__.py",
line 901, in _request
(response, content) = self._conn_request(conn, request_uri, method,
body, headers)

File "c:\python\lib\site-packages\httplib2-0.6.0-py2.7.egg\httplib2\__init__.py",
line 871, in _conn_request
response = conn.getresponse()
File "c:\python\lib\httplib.py", line 1011, in getresponse
response = self.response_class(*args, **kwds)
File "c:\python\lib\httplib.py", line 341, in __init__
self.fp = sock.makefile('rb', 0)
AttributeError: 'NoneType' object has no attribute 'makefile'


What version of the product are you using? On what operating system?
0.6.0 on Python 2.7.1 64-bit on Windows

Please provide any additional information below.

codesite...@google.com

unread,
Jun 13, 2011, 2:09:59 PM6/13/11
to httplib...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 140 by joe.gregorio: AttributeError when server is
unreachable
http://code.google.com/p/httplib2/issues/detail?id=140

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages