- Fix #745: unbound.py - idn2dname throws UnicodeError when idnname

contains trailing dot. (Fix from Ralph)


git-svn-id: file:///svn/unbound/trunk@3644 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2016-03-02 08:18:38 +00:00
parent 01f2ebcf46
commit 5dd79ce27a
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -945,7 +945,7 @@ int _ub_resolve_async(struct ub_ctx* ctx, char* name, int rrtype, int rrclass, v
:param idnname: (unicode string) IDN name
:returns: (string) domain name
"""
return '.'.join([encodings.idna.ToASCII(a) for a in idnname.split('.')])
return '.'.join([encodings.idna.ToASCII(a) if a else '' for a in idnname.split('.')])
def dname2idn(name):
"""Converts canonic domain name in IDN format to unicode string