From 7f58989032e2fa975d74b6c4559c8e666b8b7644 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Fri, 9 Mar 2018 23:46:23 -0500 Subject: [PATCH 1/2] Adding utf-8 check --- csh_ldap/group.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/csh_ldap/group.py b/csh_ldap/group.py index 05d9b0e..8319c23 100644 --- a/csh_ldap/group.py +++ b/csh_ldap/group.py @@ -35,10 +35,20 @@ def get_members(self): "(memberof=%s)" % self.__dn__, ['uid']) + ret = [] + for val in res: + val = val[1]['uid'][0] + try: + ret.append(val.decode('utf-8')) + except UnicodeDecodeError: + ret.append(val) + except KeyError: + continue + return [CSHMember(self.__lib__, - result[1]['uid'][0], + result, uid=True) - for result in res] + for result in ret] def check_member(self, member, dn=False): """Check if a Member is in the bound group. From 555ad151714918fb7e8ec9fae41c9770747216c2 Mon Sep 17 00:00:00 2001 From: Devin Matte Date: Sat, 10 Mar 2018 16:00:51 -0500 Subject: [PATCH 2/2] Version bump 2.0.2 --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b76a80f..faa1ecb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ summary = CSH LDAP ORM url = https://github.com/liam-middlebrook/csh_ldap description-file = README.md license = MIT -version = 2.0.1 +version = 2.0.2 classifier = Natural Language :: English Operating System :: POSIX :: Linux