Skip to content

Commit

Permalink
Fix urllib3 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lorien committed Sep 29, 2015
1 parent 3368a7d commit 44d931d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions grab/transport/urllib3.py
Expand Up @@ -233,10 +233,10 @@ def request(self):
body=req.data, timeout=2,
retries=retry, headers=req.headers,
preload_content=False)
except exceptions.ConnectionError as ex:
raise error.GrabConnectionError(ex.args[1][0], ex.args[1][1])
except exceptions.NewConnectionError as ex:
except exceptions.ConnectTimeoutError as ex:
raise error.GrabConnectionError('Could not create connection')
except exceptions.ProtocolError as ex:
raise error.GrabConnectionError(ex.args[1][0], ex.args[1][1])

# WTF?
self.request_head = ''
Expand Down
2 changes: 1 addition & 1 deletion runtest.py
Expand Up @@ -34,7 +34,7 @@
'test.grab_post_request',
'test.grab_request', # TODO: fix tests excluded for urllib3
'test.grab_user_agent',
'test.grab_cookies', # !!!!!!! FIX URLLIB3 TEST
'test.grab_cookies', # TODO: fix tests excluded for urllib3
'test.grab_url_processing',
# Refactor
'test.grab_proxy',
Expand Down
1 change: 0 additions & 1 deletion test/grab_cookies.py
Expand Up @@ -62,7 +62,6 @@ def test_session(self):
g.go(self.server.get_url())
self.assertTrue(len(self.server.request['cookies']) == 0)

@exclude_transport('urllib3')
def test_redirect_session(self):
g = build_grab()
self.server.response['cookies'] = {'foo': 'bar'}.items()
Expand Down

0 comments on commit 44d931d

Please sign in to comment.