1. Peter Tröger
  2. openid2rp.django

Commits

Martin von Löwis  committed 70309f9

urlopen expects bytes in 3.x; HTMLParser expects strings.

  • Participants
  • Parent commits d6d0209
  • Branches default

Comments (0)

Files changed (1)

File openid2rp/__init__.py

View file
 
     if content_type in ('text/html', 'application/xhtml+xml'):
         parser = OpenIDParser()
-        parser.feed(data)
+        parser.feed(data.decode('latin-1'))
         parser.close()
         # Yadis 6.2.5 option 1: meta tag
         if parser.xrds_location:
         if data['openid.session_type'] == "no-encryption":
             data['openid.session_type'] = ''
         del data['openid.ns']
-    res = urllib.urlopen(url, urllib.urlencode(data))
+    res = urllib.urlopen(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())