[Bug 1685547] Re: Crash in python3 with the 'file' backend

Colin Watson cjwatson at canonical.com
Thu Mar 8 11:42:51 UTC 2018


*** This bug is a duplicate of bug 1685962 ***
    https://bugs.launchpad.net/bugs/1685962

** This bug has been marked a duplicate of bug 1685962
   keyring file-backend reports backtrace with oauth

-- 
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/1685547

Title:
  Crash in python3 with the 'file' backend

Status in Kubuntu Automation:
  New
Status in python-launchpadlib package in Ubuntu:
  Confirmed

Bug description:
  Hi,

  I have a program written in python 3 which uses launchpadlib, and it's
  crashing if it tries to use the 'file' backend:

  $ 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:52:10 +0200
  The authorization page:
   (https://launchpad.net/+authorize-token?oauth_token=qp1rQXkMXWMMj0pQBHgq&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 553, in __call__
      credential_store.save(credentials, self.unique_consumer_id)
    File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 308, in save
      raise e
    File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 303, in save
      self.do_save(credentials, unique_consumer_id)
    File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 385, in do_save
      'launchpadlib', unique_key, serialized)
    File "/usr/lib/python3/dist-packages/keyring/core.py", line 48, in set_password
      _keyring_backend.set_password(service_name, username, password)
    File "/usr/lib/python3/dist-packages/keyring/backends/file.py", line 87, in set_password
      password_encrypted = self.encrypt(password.encode('utf-8'))                                                                                               
  AttributeError: 'bytes' object has no attribute 'encode' 

  As a workaround I replaced the file.py line in question with:
  password_encrypted = self.encrypt(str(password).encode('utf-8'))
  and now it works.

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



More information about the foundations-bugs mailing list