# HG changeset patch # User Mads Kiilerich # Date 1580783237 -3600 # Node ID a280c27b3c21113ed847f762c16e727c556d5438 # Parent b4095011433dbf6db164b327cd93faf01f807e8e py3: fix recaptcha Request parameter type urllib.parse.urlencode will (after making '%' encoding of unicode characters) return a str instead of the obviously correct 7-bit ascii bytes. When we need bytes, we thus have to encode to bytes. diff -r b4095011433d -r a280c27b3c21 kallithea/lib/recaptcha.py --- a/kallithea/lib/recaptcha.py Tue Feb 04 03:25:17 2020 +0100 +++ b/kallithea/lib/recaptcha.py Tue Feb 04 03:27:17 2020 +0100 @@ -34,7 +34,7 @@ 'secret': encode_if_necessary(private_key), 'remoteip': encode_if_necessary(remoteip), 'response': encode_if_necessary(g_recaptcha_response), - }) + }).encode('ascii') req = urllib2.Request( url="https://www.google.com/recaptcha/api/siteverify",