mamaduckmaster / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

AttributeError when server is unreachable #140

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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.

Original issue reported on code.google.com by jaraco%jaraco.com@gtempaccount.com on 4 Apr 2011 at 8:58

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 13 Jun 2011 at 5:14