[Bug 1685549] Re: login_with() crashes if there's no web browser installed

Launchpad Bug Tracker 1685549 at bugs.launchpad.net
Sat Sep 30 01:21:16 UTC 2017


This bug was fixed in the package python-launchpadlib - 1.10.5-1

---------------
python-launchpadlib (1.10.5-1) unstable; urgency=medium

  * Team upload.
  * New upstream release:
    - Fix fallback if authorizing a token with a browser raises
      webbrowser.Error (LP: #1685549).

 -- Colin Watson <cjwatson at debian.org>  Tue, 05 Sep 2017 12:36:21 +0100

** Changed in: python-launchpadlib (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-launchpadlib in Ubuntu.
https://bugs.launchpad.net/bugs/1685549

Title:
  login_with() crashes if there's no web browser installed

Status in Kubuntu Automation:
  New
Status in python-launchpadlib package in Ubuntu:
  Fix Released

Bug description:
  Hi,

  I have a program which uses launchpadlib's login_with, and it's
  crashing like this in a system without any browser installed:

  $ kubuntu-retry-builds -r frameworks -d artful
  Logs are activated and are going to be stored in:
  /home/santa/kubuntu-retry-builds_logs
  If you want to disable this feature, edit your ~/kubuntu-automation.conf
  Date started: Sat, 22 Apr 2017 22:36:33 +0200
  The authorization page:
   (https://launchpad.net/+authorize-token?oauth_token=tKJzWL79XggpC6g6W3Hv&allow_permission=DESKTOP_INTEGRATION)
  should be opening in your browser. Use your browser to authorize
  this program to access Launchpad on your behalf.
  Waiting to hear from Launchpad about your decision...
  Traceback (most recent call last):
    File "/usr/bin/kubuntu-retry-builds", line 90, in <module>
      lp = Launchpad.login_with("kubuntu-retry-builds", "production")
    File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 549, in login_with
      credential_save_failed, version)
    File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 356, in _authorize_token_and_login
      credentials = authorization_engine(credentials, credential_store)
    File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 548, in __call__
      self.make_end_user_authorize_token(credentials, request_token_string)
    File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 656, in make_end_user_authorize_token
      if browser_obj is not None:
  UnboundLocalError: local variable 'browser_obj' referenced before assignment

  replacing this code
          if browser_obj is not None:
              webbrowser.open(authorization_url)
  with this
          if browser is not None:
              webbrowser.open(authorization_url)
  fixes the problem for me

To manage notifications about this bug go to:
https://bugs.launchpad.net/ka/+bug/1685549/+subscriptions



More information about the foundations-bugs mailing list