From 5dd79ce27acbfe821d5dce2332283e38b75832cd Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 2 Mar 2016 08:18:38 +0000 Subject: [PATCH] - 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 --- doc/Changelog | 2 ++ libunbound/python/libunbound.i | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 29a172029..9184d1411 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,8 @@ - 1.5.8 release tag - trunk contains 1.5.9 in development. - iana portlist update. + - Fix #745: unbound.py - idn2dname throws UnicodeError when idnname + contains trailing dot. 24 February 2016: Wouter - Fix OpenBSD asynclook lock free that gets used later (fix test code). diff --git a/libunbound/python/libunbound.i b/libunbound/python/libunbound.i index 50a9b67ac..84a536929 100644 --- a/libunbound/python/libunbound.i +++ b/libunbound/python/libunbound.i @@ -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 -- 2.47.2