← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-CanonicalSSOAPI into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-CanonicalSSOAPI into launchpad:master.

Commit message:
Fix CanonicalSSOAPI for Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/398989

On Python 3, `openid_identifier` is typically already text.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-CanonicalSSOAPI into launchpad:master.
diff --git a/lib/lp/registry/xmlrpc/canonicalsso.py b/lib/lp/registry/xmlrpc/canonicalsso.py
index c202ffa..9aa5c79 100644
--- a/lib/lp/registry/xmlrpc/canonicalsso.py
+++ b/lib/lp/registry/xmlrpc/canonicalsso.py
@@ -9,7 +9,7 @@ __all__ = [
     'CanonicalSSOApplication',
     ]
 
-
+import six
 from zope.component import getUtility
 from zope.interface import implementer
 from zope.security.proxy import removeSecurityProxy
@@ -30,7 +30,7 @@ class CanonicalSSOAPI(LaunchpadXMLRPCView):
     def getPersonDetailsByOpenIDIdentifier(self, openid_identifier):
         try:
             account = getUtility(IAccountSet).getByOpenIDIdentifier(
-                openid_identifier.decode('ascii'))
+                six.ensure_text(openid_identifier, 'ascii'))
         except LookupError:
             return None
         person = IPerson(account, None)