ppa-generate-keys broken due to unicode issue

Bug #576405 reported by Michael Nelson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Michael Nelson

Bug Description

Since the 10.04 rollout ppa-generate-keys script has been failing with:

{{{
2010-05-04 22:00:41 INFO Generating signing key for PPA for Kristian Klette
2010-05-04 22:02:32 DEBUG Removing lock file: /var/lock/launchpad-ppa-
generate-keys.lock
Traceback (most recent call last):
 File "/srv/launchpad.net/codelines/current/cronscripts/ppa-generate-
keys.py", line 21, in <module>
   script.lock_and_run()
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/lp/services/scripts/base.py", line 280, in lock_and_run
   implicit_begin=implicit_begin, isolation=isolation)
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/lp/services/scripts/base.py", line 238, in run
   self.main()
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/lp/soyuz/scripts/ppakeygenerator.py", line 62, in main
   self.generateKey(archive)
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/lp/soyuz/scripts/ppakeygenerator.py", line 33, in generateKey
   archive_signing_key.generateSigningKey()
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/lp/archivepublisher/archivesigningkey.py", line 75, in
generateSigningKey
   secret_key = getUtility(IGPGHandler).generateKey(key_displayname)
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/canonical/launchpad/utilities/gpghandler.py", line 307, in
generateKey
   secret_keys = list(self.localKeys(result.fpr, secret=True))
 File "/srv/launchpad.net/codelines/ppa-
rev-9329/lib/canonical/launchpad/utilities/gpghandler.py", line 402, in
localKeys
   for key in ctx.keylist(filter, secret):
TypeError: first argument must be a string or sequence of strings
}}}

Maxb says:

{{{
The new pygpgme's result.fpr is now a unicode object, but apparently the filter argument to keylist is still wanted as a bytestring.
}}}

Tags: lp-soyuz qa-ok

Related branches

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Although the fix itself is trivial as Max pointed out:

http://pastebin.ubuntu.com/429118/

Tests didn't fail because we don't actually call the real IGPGHandler.generateKey() - due to entropy needs (and general slowness). However, we're currently mocking a lot more than simply the gpgme.Context().genkey() call in our tests, and the code can be refactored so that the tests do test everything but that, and demonstrate this issue bug. I've got a branch that does this, but it needs a bit of work still, so in the mean time I'll try to get the above cowboy-ed.

Grepping for generateKey shows that it's only soyuz code that calls this (archivesigning and ppa key generation).

Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in soyuz:
status: In Progress → Fix Committed
tags: added: qa-needstesting
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in soyuz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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