-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
Issue description:
In SimpleLDAPObject.compare_ext()
, with bytes_mode=False
, the arguments dn
and attr
are converted via ._bytesify_input()
. The argument value
, is not, but I believe is should be. Code is here:
python-ldap/Lib/ldap/ldapobject.py
Lines 513 to 515 in f23f790
if PY2: | |
dn = self._bytesify_input('dn', dn) | |
attr = self._bytesify_input('attr', attr) |
Without the conversion, I receive errors that look like:
...
File "/home/jon/devel/python-ldap/Lib/ldap/ldapobject.py", line 534, in compare_s
return self.compare_ext_s(dn,attr,value,None,None)
File "/home/jon/devel/python-ldap/Lib/ldap/ldapobject.py", line 519, in compare_ext_s
msgid = self.compare_ext(dn,attr,value,serverctrls,clientctrls)
File "/home/jon/devel/python-ldap/Lib/ldap/ldapobject.py", line 516, in compare_ext
return self._ldap_call(self._l.compare_ext,dn,attr,value,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls))
File "/home/jon/devel/python-ldap/Lib/ldap/ldapobject.py", line 313, in _ldap_call
result = func(*args,**kwargs)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 7: ordinal not in range(128)
Steps to reproduce:
- Use Python 2.7
- Initialize python-ldap with
bytes_mode=False
- Call
.compare_s()
where all 3 arguments contain non-ascii characters
Operating system:
Fedora release 27
Python version:
Python 2.7
python-ldap version:
master
belugame and kairichard
Metadata
Metadata
Assignees
Labels
No labels