[python-ldap] syncrepl fix for pyasn1 >= 0.3
michael at stroeder.com
Sat Nov 11 14:56:05 EST 2017
Michael Ströder wrote:
> All people installing/upgrading
> from PyPI would be happy with python-ldap 2.5.x and pyasn1 0.3.x.
I've decided to start 2.5.0 incorporating this patch without the
backward-compability expressions. But I have some doubts.
For example in class SSSResponseControl I now see this code:
attribute_type_error = p.getComponentByName('attributeType')
self.attribute_type_error = attribute_type_error
This does not set class attribute attribute_type_error at all in case
there was no error. So this also changes the API for the calling
application because instead of checking for
foo_sss.attribute_type_error is None
it has to check for
Hmm, I could implement a custom ResponseControl.__getattr__() which
returns None in case of non-existent but known class attributes.
But frankly it would be more nice if pyasn1 method getComponentByName()
would take another optional parameter for default value returned in case
So I could simply define a default value (here None)
and be done with it. This would avoid a lot of if-statements with
.hasValue() and the ResponseControl.__getattr__() workaround.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3829 bytes
Desc: S/MIME Cryptographic Signature
More information about the python-ldap