summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-27 12:06:54 +0100
committerJan Cholasta <jcholast@redhat.com>2017-02-08 08:32:44 +0100
commita584758cfb87567a9c640ae107903b0f6c9fec30 (patch)
tree75b69828efe84d5803bb80561b07831e7031913a /ipaserver
parent03d0a55e8a21a334ca4dc625527cae93633a7314 (diff)
downloadfreeipa-a584758cfb87567a9c640ae107903b0f6c9fec30.tar.gz
freeipa-a584758cfb87567a9c640ae107903b0f6c9fec30.tar.xz
freeipa-a584758cfb87567a9c640ae107903b0f6c9fec30.zip
py3: _convert_to_idna: fix bytes/unicode mistmatch
ToASCII() returns bytes, it must be decoded to unicode https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/dns.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py
index 97f6527d0..40c9b5124 100644
--- a/ipaserver/plugins/dns.py
+++ b/ipaserver/plugins/dns.py
@@ -1620,8 +1620,9 @@ def _convert_to_idna(value):
idna_val = encodings.idna.nameprep(idna_val)
idna_val = re.split(r'(?<!\\)\.', idna_val)
idna_val = u'%s%s%s' % (start_dot,
- u'.'.join(encodings.idna.ToASCII(x)
- for x in idna_val),
+ u'.'.join(
+ encodings.idna.ToASCII(x).decode('ascii')
+ for x in idna_val),
end_dot)
return idna_val
except Exception: