[python-ldap] bug: python-ldap 2.4.11 adds a dependency on pyasn1

Florent florent.xicluna at gmail.com
Wed May 29 22:12:22 CEST 2013


With this patch, the tests pass.

Thank you,

--
Florent

2013/5/29 Michael Ströder <michael at stroeder.com>:
> Florent wrote:
>> it seems that the latest release of python-ldap broke our tests.
>> The module has gained a strong dependency on pyasn1, which is not declared in
>> setup.py.
>> IMHO, this dependency should stay optional (it was ok with version 2.4.10).
>>
>>
>>   File "/srv/buildbot/parts/demo/build/src/addons/users_ldap/users_ldap.py", line 23, in <module>
>>     import ldap
>>   File "/srv/openerp/.buildout/eggs/python_ldap-2.4.11-py2.6-linux-x86_64.egg/ldap/__init__.py", line 85, in <module>
>>     from functions import open,initialize,init,get_option,set_option
>>   File "/srv/openerp/.buildout/eggs/python_ldap-2.4.11-py2.6-linux-x86_64.egg/ldap/functions.py", line 35, in <module>
>>     from ldap.ldapobject import LDAPObject
>>   File "/srv/openerp/.buildout/eggs/python_ldap-2.4.11-py2.6-linux-x86_64.egg/ldap/ldapobject.py", line 38, in <module>
>>     from ldap.controls import LDAPControl,DecodeControlTuples,RequestControlTuples
>>   File "/srv/openerp/.buildout/eggs/python_ldap-2.4.11-py2.6-linux-x86_64.egg/ldap/controls/__init__.py", line 38, in <module>
>>     from pyasn1.error import PyAsn1Error
>> ImportError: No module named pyasn1.error
>
> Could you please check whether the patch below solves that for you?
>
> Ciao, Michael.
>
> P.S.: It's definitely worth to subscribe to the mailing list.
>
> Index: Lib/ldap/controls/__init__.py
> ===================================================================
> RCS file: /cvsroot/python-ldap/python-ldap/Lib/ldap/controls/__init__.py,v
> retrieving revision 1.8
> diff -u -r1.8 __init__.py
> --- Lib/ldap/controls/__init__.py       10 Jul 2012 20:23:44 -0000      1.8
> +++ Lib/ldap/controls/__init__.py       29 May 2013 19:51:45 -0000
> @@ -35,7 +35,11 @@
>  KNOWN_RESPONSE_CONTROLS = {}
>
>  import _ldap,ldap
> -from pyasn1.error import PyAsn1Error
> +
> +try:
> +  from pyasn1.error import PyAsn1Error
> +except ImportError:
> +  PyAsn1Error = None
>
>
>  class RequestControl:
>


More information about the python-ldap mailing list