ppa-generate-keys broken due to unicode issue
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/
generate-keys.lock
Traceback (most recent call last):
File "/srv/launchpad
keys.py", line 21, in <module>
script.
File "/srv/launchpad
rev-9329/
implicit_
File "/srv/launchpad
rev-9329/
self.main()
File "/srv/launchpad
rev-9329/
self.
File "/srv/launchpad
rev-9329/
archive_
File "/srv/launchpad
rev-9329/
generateSigningKey
secret_key = getUtility(
File "/srv/launchpad
rev-9329/
generateKey
secret_keys = list(self.
File "/srv/launchpad
rev-9329/
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.
}}}
Related branches
- Abel Deuring (community): Approve (code)
-
Diff: 60 lines (+31/-2)2 files modifiedlib/canonical/launchpad/utilities/ftests/test_gpghandler.py (+24/-2)
lib/canonical/launchpad/utilities/gpghandler.py (+7/-0)
tags: |
added: qa-ok removed: qa-needstesting |
Changed in soyuz: | |
status: | Fix Committed → Fix Released |
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).