changeset ba35febd92db in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=ba35febd92db description: prevent error when converting idn to ascii strings. Fixes #7995
diffstat:
src/common/helpers.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diffs (15 lines):
diff -r ea47b61e6741 -r ba35febd92db src/common/helpers.py --- a/src/common/helpers.py Tue Mar 17 22:06:36 2015 +0100 +++ b/src/common/helpers.py Wed Mar 25 10:05:29 2015 +0100 @@ -123,7 +123,10 @@ labels = idna.dots.split(host) converted_labels = [] for label in labels: - converted_labels.append(idna.ToASCII(label).decode('utf-8')) + if label: + converted_labels.append(idna.ToASCII(label).decode('utf-8')) + else: + converted_labels.append('') return ".".join(converted_labels)
def ascii_to_idn(host):