get_request_token throws a TypeError

Bug #336039 reported by Rick Spencer
2
Affects Status Importance Assigned to Milestone
launchpadlib
New
Undecided
Unassigned
python-httplib2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Using 0.2~bzr35-0ubuntu1

This code:
 web_root = EDGE_SERVICE_ROOT
 token_url = EDGE_SERVICE_ROOT

  credentials = Credentials("rickspencer3-client")
  web_root_uri = URI(token_url)
  web_root_uri.path = ""
  web_root_uri.host = web_root_uri.host.replace("api.", "", 1)
  token_url = str(web_root_uri.ensureSlash())
  print "Web root is " + web_root
  print "Getting token from " + token_url
  authorization_url = credentials.get_request_token(web_root=token_url)

Throws this error:
Traceback (most recent call last):
  File "DashboardWindow.py", line 69, in <module>
    w = DashboardWindow()
  File "DashboardWindow.py", line 26, in __init__
    lp = logon_task(None)
  File "DashboardWindow.py", line 63, in logon_task
    return LaunchpadUtils.set_credentials()
  File "/media/disk/canonical/trunk/LaunchpadUtils.py", line 51, in set_credentials
    authorization_url = credentials.get_request_token(web_root=token_url)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/credentials.py", line 146, in get_request_token
    url, method='POST', body=urlencode(params))
  File "/var/lib/python-support/python2.6/httplib2/__init__.py", line 1050, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/var/lib/python-support/python2.6/httplib2/__init__.py", line 854, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/var/lib/python-support/python2.6/httplib2/__init__.py", line 823, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 874, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.6/httplib.py", line 911, in _send_request
    self.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 868, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 740, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 699, in send
    self.connect()
  File "/var/lib/python-support/python2.6/httplib2/__init__.py", line 736, in connect
    sock.settimeout(self.timeout)
  File "<string>", line 1, in settimeout
TypeError: a float is required

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

should have included ...

This is running netbook remix alpha 5, fully updated.

Revision history for this message
Markus Korn (thekorn) wrote :

This looks like a bug in the python-httplib2 version in jaunty to me, and seems to be unrelated to launchpadlib.

Revision history for this message
Markus Korn (thekorn) wrote :

without knowing what bug 336067 is exactly about, python-httplib2 seems to be broken in python2.6
looking at the upstream patch shows changes in the set_timeout related code

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.