Fails to generate oauth token correctly when run in python3

Bug #1526563 reported by Robert Bruce Park
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
launchpadlib
New
Undecided
Unassigned

Bug Description

This traceback arises when there is a problem with an oauth token in python3:

Traceback (most recent call last):
  File "/var/lib/citrain/citrain/status.py", line 53, in <module>
    run_script(__name__, __doc__, lambda: stock_main(update_status))
  File "/var/lib/citrain/cupstream2distro/utils.py", line 198, in run_script
    sys.exit(main())
  File "/var/lib/citrain/citrain/status.py", line 53, in <lambda>
    run_script(__name__, __doc__, lambda: stock_main(update_status))
  File "/var/lib/citrain/cupstream2distro/silomanager.py", line 139, in stock_main
    body(silo_state)
  File "/var/lib/citrain/citrain/status.py", line 46, in update_status
    logging.info(silo_state.summarize(status=False))
  File "/var/lib/citrain/cupstream2distro/silomanager.py", line 318, in summarize
    dest=self.dest.web_link,
  File "/var/lib/citrain/cupstream2distro/utils.py", line 117, in memoizer
    cache[key] = obj(*args, **kwargs)
  File "/var/lib/citrain/cupstream2distro/silomanager.py", line 465, in dest
    series = self._series
  File "/var/lib/citrain/cupstream2distro/silomanager.py", line 185, in __getattr__
    self.load_bileto()
  File "/var/lib/citrain/cupstream2distro/silomanager.py", line 284, in load_bileto
    creator = lp.people[creator]
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 1001, in __getitem__
    shim_resource._ensure_representation()
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/resource.py", line 382, in _ensure_representation
    representation = self._root._browser.get(self._wadl_resource)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 436, in get
    response, content = self._request(url, extra_headers=headers)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 387, in _request
    str(url), method=method, body=data, headers=headers)
  File "/usr/lib/python3/dist-packages/lazr/restfulclient/_browser.py", line 357, in _request_and_retry
    url, method=method, body=body, headers=headers)
  File "/usr/lib/python3/dist-packages/httplib2/__init__.py", line 1241, in request
    (response, new_content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 132, in _request
    return self.retry_on_bad_token(response, content, *args)
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 139, in retry_on_bad_token
    if (self._bad_oauth_token(response, content)
  File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 125, in _bad_oauth_token
    (content.startswith("Expired token")
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Would be nice if this worked in python3 as otherwise I'm using the rest of the API without issue.

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.