From 27f8f9f03d69276f9ee410169b76574da2461794 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Jun 01 2017 07:24:24 +0000 Subject: py3: ipaldap: encode Boolean as bytes Python LDAP requires bytes https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta Reviewed-By: Stanislav Laznicka --- diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 1b0aadd..9a42312 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -847,9 +847,9 @@ class LDAPClient(object): # entered for a boolean value instead of the boolean clause. if isinstance(val, bool): if val: - return 'TRUE' + return b'TRUE' else: - return 'FALSE' + return b'FALSE' elif isinstance(val, (unicode, six.integer_types, Decimal, DN, Principal)): return six.text_type(val).encode('utf-8')