[python-ldap] Issues with modifiModlist

Facundo Acevedo facevedo at openmailbox.org
Thu Nov 24 07:58:31 EST 2016


Hello, I've realized that the parameter of the old attribute is the same
length that the new, modifyModlist do not works as expected, it returns
an empty list.

Example code for reproduce the issue:

import ldap.modlist as modlist

value = "Python"
reversed_value = value[::-1]
old = {}
new = {}
old["sn"] = value
new["sn"] = reversed_value

ldif = modlist.modifyModlist(old, new)


I think the problem is in ldap/modlist.py:95
replace_attr_value = len(old_value)!=len(new_value)


Version information:
Name: python-ldap
Version: 2.4.27
Python 2.7.12



Greetings!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xFE5FD0C9.asc
Type: application/pgp-keys
Size: 7810 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20161124/1f466b19/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20161124/1f466b19/attachment.sig>


More information about the python-ldap mailing list