Cannot authorize on OS X

Bug #1516080 reported by Jonathan Lange
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
launchpadlib
Fix Released
High
Colin Watson

Bug Description

I just tried to run a simple script that depends on launchpadlib. I got this error:

$ python ./scripts/_lp_release.py
The authorization page:
 (https://launchpad.net/+authorize-token?oauth_token=<<REDACTED>>&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Traceback (most recent call last):
  File "./scripts/_lp_release.py", line 232, in <module>
    sys.exit(main(sys.argv))
  File "./scripts/_lp_release.py", line 227, in main
    APP_NAME, SERVICE_ROOT, CACHE_DIR, credentials_file='.lp_creds')
  File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/launchpadlib/launchpad.py", line 544, in login_with
    credential_save_failed, version)
  File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/launchpadlib/launchpad.py", line 351, in _authorize_token_and_login
    credentials = authorization_engine(credentials, credential_store)
  File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/launchpadlib/credentials.py", line 545, in __call__
    self.make_end_user_authorize_token(credentials, request_token_string)
  File "/Users/jml/.virtualenvs/testtools/lib/python2.7/site-packages/launchpadlib/credentials.py", line 637, in make_end_user_authorize_token
    browser = webbrowser.get().basename
AttributeError: 'MacOSXOSAScript' object has no attribute 'basename'

Related branches

Revision history for this message
Jonathan Lange (jml) wrote :

~cjwatson provides http://paste.ubuntu.com/13248463/, which seems to work.

Colin Watson (cjwatson)
Changed in launchpadlib:
importance: Undecided → High
assignee: nobody → Colin Watson (cjwatson)
status: New → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

1.10.4 (2016-07-12)
===================
- Fix _bad_oauth_token crash on Python 3. [bug=1471894]
- Time out make_end_user_authorize_token after 15 minutes.
- Ignore PendingDeprecationWarning from lazr.restfulclient. [bug=1473577]
- Ask forgiveness rather than permission when creating cache directories.
- Fix browser token authorization on OS X. [bug=1516080]

Changed in launchpadlib:
status: Fix Committed → 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.