intertwingly

It’s just data

JanRain python-openid-1.2.0 and 404 on openid.server


I got a report from Bob Aman that my “blog broke”, along with the following traceback:

traceback:Traceback (most recent call last):
 File "gateway.cgi", line 39, in ?
   post(url)
 File "/home/rubys/mombo/post.py", line 418, in post
   {'name': param('name'), 'url': param('url'), 'email': param('email'),
 File "/home/rubys/mombo/identity.py", line 18, in lookup
   request = server.begin(id)
 File "/home/rubys/python-openid-combo-20061208/python-openid-1.2.0/openid/consumer/consumer.py",
line 308, in begin
   return self.beginWithoutDiscovery(service)
 File "/home/rubys/python-openid-combo-20061208/python-openid-1.2.0/openid/consumer/consumer.py",
line 331, in beginWithoutDiscovery
   auth_req = self.consumer.begin(service)
 File "/home/rubys/python-openid-combo-20061208/python-openid-1.2.0/openid/consumer/consumer.py",
line 423, in begin
   assoc = self._getAssociation(service_endpoint.server_url)
 File "/home/rubys/python-openid-combo-20061208/python-openid-1.2.0/openid/consumer/consumer.py",
line 627, in _getAssociation
   assoc = self._parseAssociation(
 File "/home/rubys/python-openid-combo-20061208/python-openid-1.2.0/openid/consumer/consumer.py",
line 654, in _parseAssociation
   assoc_type = results['assoc_type']
TypeError: unsubscriptable object

A quick search turns up nothing.

Checking Bob’s server, I find:

<link rel="openid.server" 
      href="http://sporkmonger.pip.verisignlabs.com/server/" />
<link rel="openid.delegate" 
      href="http://sporkmonger.pip.verisignlabs.com/" />

The server URI provided returns a 404, presumably as the result of a configuration error.  It seems likely that https://pip.verisignlabs.com/server was what is intended.  In any case, JanRain Python OpenId 1.2.0 responds rather poorly to this situation, and the following patch works around this bug:

--- openid/consumer/consumer.base       2007-07-25 08:50:10.000000000 -0400
+++ openid/consumer/consumer.py 2007-07-25 08:50:21.000000000 -0400
@@ -624,6 +624,7 @@
                             (str(why),))
                 assoc = None
             else:
+                if response == None: return None # hack
                 assoc = self._parseAssociation(
                     response, assoc_session, server_url)

Now off to report the problem: done.