stringprep: Make pure-Python punycode() return bytes.

Fixes #3366.
This commit is contained in:
Emmanuel Gil Peyrot 2017-12-27 15:48:42 +01:00
parent d73f56a7af
commit c6443af29a

View file

@ -114,7 +114,7 @@ def punycode(domain):
if char in ILLEGAL_CHARS: if char in ILLEGAL_CHARS:
raise StringprepError raise StringprepError
domain_parts.append(label) domain_parts.append(label.encode('ascii'))
return b'.'.join(domain_parts) return b'.'.join(domain_parts)
logging.getLogger(__name__).warning('Using slower stringprep, consider ' logging.getLogger(__name__).warning('Using slower stringprep, consider '