summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-09-17 18:46:14 +0200
committerMartin Basti <mbasti@redhat.com>2015-10-22 18:34:46 +0200
commit8a2b65a35731470da0befeb01a4e863d782f0e6f (patch)
treec334d611ce5c702577345ec199086af6f59aa576 /ipapython
parent0a23afeab2bcba2d2694281cfc558f2821821f59 (diff)
downloadfreeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.tar.gz
freeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.tar.xz
freeipa-8a2b65a35731470da0befeb01a4e863d782f0e6f.zip
Fix more bytes/unicode issues
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/dnsutil.py2
-rw-r--r--ipapython/ipaldap.py5
2 files changed, 4 insertions, 3 deletions
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: