Mercurial > kallithea
changeset 8166:a280c27b3c21
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.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 04 Feb 2020 03:27:17 +0100 |
parents | b4095011433d |
children | 8114623895cc |
files | kallithea/lib/recaptcha.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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",