From 8a2b65a35731470da0befeb01a4e863d782f0e6f Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 17 Sep 2015 18:46:14 +0200 Subject: Fix more bytes/unicode issues Reviewed-By: Tomas Babej --- ipapython/dnsutil.py | 2 +- ipapython/ipaldap.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'ipapython') diff --git a/ipapython/dnsutil.py b/ipapython/dnsutil.py index 7844d7bec..a11d744d7 100644 --- a/ipapython/dnsutil.py +++ b/ipapython/dnsutil.py @@ -39,7 +39,7 @@ class DNSName(dns.name.Name): try: if isinstance(labels, six.string_types): #pylint: disable=E1101 - labels = dns.name.from_unicode(unicode(labels), origin).labels + labels = dns.name.from_text(unicode(labels), origin).labels elif isinstance(labels, dns.name.Name): labels = labels.labels diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 38c6aad04..7e5bc04fe 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -1314,8 +1314,9 @@ class LDAPClient(object): # pass arguments to python-ldap with self.error_handler(): - filter = self.encode(filter) - attrs_list = self.encode(attrs_list) + if six.PY2: + filter = self.encode(filter) + attrs_list = self.encode(attrs_list) while True: if paged_search: -- cgit