Merge pull request #5 from patrickdepinguin/py3fix

imapserver.py: fix __xoauth2handler in Python 3
This commit is contained in:
Rodolfo García Peñas (kix) 2020-09-30 23:12:33 +02:00 committed by GitHub
commit e62c8b39bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,7 +243,7 @@ class IMAPServer():
socket.socket = self.authproxied_socket socket.socket = self.authproxied_socket
try: try:
response = urllib.request.urlopen( response = urllib.request.urlopen(
self.oauth2_request_url, urllib.parse.urlencode(params)).read() self.oauth2_request_url, urllib.parse.urlencode(params).encode('utf-8')).read()
except Exception as e: except Exception as e:
try: try:
msg = "%s (configuration is: %s)" % (e, str(params)) msg = "%s (configuration is: %s)" % (e, str(params))