Commit 3f6e0c92 authored by Yann Leboulanger's avatar Yann Leboulanger

prevent error when converting idn to ascii strings. Fixes #7995

parent 923378df
......@@ -122,7 +122,10 @@ def idn_to_ascii(host):
labels = idna.dots.split(host)
converted_labels = []
for label in labels:
converted_labels.append(idna.ToASCII(label))
if label:
converted_labels.append(idna.ToASCII(label))
else:
converted_labels.append('')
return ".".join(converted_labels)
def ascii_to_idn(host):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment