Merge ~cjwatson/launchpad:py3-sshkeyset-new into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: ae8ba9c52783bef8c01bb57a14a44d54f3116813
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-sshkeyset-new
Merge into: launchpad:master
Diff against target: 13 lines (+1/-1)
1 file modified
lib/lp/registry/model/person.py (+1/-1)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+395291@code.launchpad.net

Commit message

Fix SSHKeySet.new on Python 3

Description of the change

We need to pass bytes to Key.fromString.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/model/person.py b/lib/lp/registry/model/person.py
2index e1406ca..9834a0a 100644
3--- a/lib/lp/registry/model/person.py
4+++ b/lib/lp/registry/model/person.py
5@@ -4131,7 +4131,7 @@ class SSHKeySet:
6
7 if check_key:
8 try:
9- key = Key.fromString(sshkey)
10+ key = Key.fromString(sshkey.encode("UTF-8"))
11 except Exception as e:
12 raise SSHKeyAdditionError(key=sshkey, exception=e)
13 if kind != key.sshType():

Subscribers

People subscribed via source and target branches

to status/vote changes: