Merge pull request #2041 from rif/master

fix recaptcha2 for python3
This commit is contained in:
mdipierro
2018-11-01 08:21:11 -07:00
committed by GitHub
+2 -2
View File
@@ -905,14 +905,14 @@ class Recaptcha2(DIV):
})
request = urllib2.Request(
url=self.VERIFY_SERVER,
data=params,
data=to_bytes(params),
headers={'Content-type': 'application/x-www-form-urlencoded',
'User-agent': 'reCAPTCHA Python'})
httpresp = urllib2.urlopen(request)
content = httpresp.read()
httpresp.close()
try:
response_dict = json.loads(content)
response_dict = json.loads(to_native(content))
except:
self.errors['captcha'] = self.error_message
return False