[Python-checkins] r88923 - tracker/instances/python-dev/lib/openid2rp.py

martin.v.loewis python-checkins at python.org
Fri Nov 25 01:36:04 CET 2011


Author: martin.v.loewis
Date: Fri Nov 25 01:36:04 2011
New Revision: 88923

Log:
Use FancyURLopener correctly.


Modified:
   tracker/instances/python-dev/lib/openid2rp.py

Modified: tracker/instances/python-dev/lib/openid2rp.py
==============================================================================
--- tracker/instances/python-dev/lib/openid2rp.py	(original)
+++ tracker/instances/python-dev/lib/openid2rp.py	Fri Nov 25 01:36:04 2011
@@ -435,7 +435,7 @@
         if data['openid.session_type'] == "no-encryption":
             data['openid.session_type'] = ''
         del data['openid.ns']
-    res = FancyURLopener(url, b(urllib.urlencode(data)))
+    res = FancyURLopener().open(url, b(urllib.urlencode(data)))
     if res.getcode() != 200:
         raise ValueError, "OpenID provider refuses connection with status %d" % res.getcode()
     data = parse_response(res.read())
@@ -567,7 +567,7 @@
     # Exact copies of all fields from the authentication response, except for
     # "openid.mode"
     request.extend((k, v) for k, (v,) in response.items() if 'openid.mode' != k)
-    res = FancyURLopener(op_endpoint, urllib.urlencode(request))
+    res = FancyURLopener().open(op_endpoint, urllib.urlencode(request))
     if 200 != res.getcode():
         raise NotAuthenticated(NotAuthenticated.CONNECTION_REFUSED, res.getcode())
     response = parse_response(res.read())


More information about the Python-checkins mailing list