In [3]: lp = launchpad.Launchpad.login_with('foobar', 'production', credentials_file='foobzr.txt')
The authorization page:
(https://launchpad.net/+authorize-token?oauth_token=BMSz4M10Pxxmf2KP5XC5&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...
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-3-1ce1e4c0d8e1> in <module>()
----> 1 lp = launchpad.Launchpad.login_with('foobar', 'production', credentials_file='foobzr.txt')
/usr/lib/python3/dist-packages/launchpadlib/launchpad.py in login_with(cls, application_name, service_root, launchpadlib_dir, timeout, proxy_info, authorization_engine, allow_access_levels, max_failed_attempts, credentials_file, version, consumer_name, credential_save_failed, credential_store)
547 cache_path, timeout, proxy_info, authorization_engine,
548 allow_access_levels, credential_store,
--> 549 credential_save_failed, version)
550
551 @classmethod
/usr/lib/python3/dist-packages/launchpadlib/launchpad.py in _authorize_token_and_login(cls, consumer_name, service_root, cache, timeout, proxy_info, authorization_engine, allow_access_levels, credential_store, credential_save_failed, version)
354 # They're not there. Acquire new credentials using the
355 # authorization engine.
--> 356 credentials = authorization_engine(credentials, credential_store)
357 else:
358 # We acquired credentials. But, the application name
/usr/lib/python3/dist-packages/launchpadlib/credentials.py in __call__(self, credentials, credential_store)
546 request_token_string = self.get_request_token(credentials)
547 # Hand off control to the end-user.
--> 548 self.make_end_user_authorize_token(credentials, request_token_string)
549 if credentials.access_token is None:
550 # The end-user refused to authorize the application.
/usr/lib/python3/dist-packages/launchpadlib/credentials.py in make_end_user_authorize_token(self, credentials, request_token)
654
655 self.output(self.WAITING_FOR_LAUNCHPAD)
--> 656 if browser_obj is not None:
657 webbrowser.open(authorization_url)
658 start_time = time.time()
UnboundLocalError: local variable 'browser_obj' referenced before assignment