oauth import doesn't work on python3

Bug #1672458 reported by Alberto Donato
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient
Fix Released
High
Colin Watson

Bug Description

launchpadlib doesn't work on python3 because oauth import breaks:

$ virtualenv -p python3.5 ve
$ ve/bin/pip install -e bzr+ssh://bazaar.launchpad.net/+branch/lazr.restfulclient/#egg=lazr.restfulclient
$ ve/bin/pip install -e bzr+ssh://bazaar.launchpad.net/+branch/launchpadlib/#egg=launchpadlib
$ ve/bin/python3.5 -c 'from launchpadlib.launchpad import Launchpad'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ack/Desktop/ve/src/launchpadlib/src/launchpadlib/launchpad.py", line 44, in <module>
    from lazr.restfulclient.authorize.oauth import SystemWideConsumer
  File "/home/ack/Desktop/ve/src/lazr.restfulclient/src/lazr/restfulclient/authorize/oauth.py", line 33, in <module>
    oauth = __import__('oauth.oauth', {}).oauth
  File "/home/ack/Desktop/ve/lib/python3.5/site-packages/oauth/oauth.py", line 29, in <module>
    import urlparse
ImportError: No module named 'urlparse'

note that I used lazr.restfulclient from trunk since the version on pypi fail to install on python3

Related branches

Colin Watson (cjwatson)
affects: launchpadlib → lazr.restfulclient
Revision history for this message
Colin Watson (cjwatson) wrote :

This works with the python3-oauth package in Ubuntu (which has had 2to3 run over it), just not to the packages available on PyPI. To fix this we need to port to oauthlib or similar.

Revision history for this message
Nico Schlömer (nschloe) wrote :

Yep, this needs to happen for everyone who gets launchpadlib from pip. Or remove it from pypi.org.

Colin Watson (cjwatson)
no longer affects: launchpadlib
Changed in lazr.restfulclient:
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → Triaged
Colin Watson (cjwatson)
Changed in lazr.restfulclient:
status: Triaged → In Progress
Revision history for this message
Colin Watson (cjwatson) wrote :

0.14.0 (2018-05-08)
===================

  - Switch from buildout to tox.
  - Port from oauth to oauthlib. Some tests still need to use oauth until
    lazr.authentication is ported. [bug=1672458]
  - Use the distro module rather than platform.linux_distribution, since the
    latter is deprecated in Python 3.5 and will be removed in 3.7.
    [bug=1473577]

Changed in lazr.restfulclient:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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