mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
03d0a55e8a
commit
a584758cfb
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user