[python-ldap] Error trying to test python-ldap install.
Scott Batchelor
scott.batchelor at capstonetech.com
Thu Aug 11 19:24:44 CEST 2011
Admittedly, I am new to both python and python-ldap so I may be missing
something simple. I am trying to run the following script from the doc
example.
I have verified that I can connect to the LDAP server and return the desired
result via a simple ldapsearch command line.
Here is the result of checking the module install.
$ python c "import ldap;print ldap._version_"
2.4.4
I have checked to make sure that the module is being called from the correct
python install with:
$ python c "import ldap;print ldap._file_"
And that checks out ok.
Upon trying to run the following script: **Note dummy values have replaced
real values to protect the innocent.
import ldap, sys
l = ldap.initialize('ldap//localhost:389')
l.simple_bind_s()
l.search_s('base',ldap.SCOPE_SUBTREE,'filter')
I receive this error:
raceback (most recent call last):
File "simple.py", line 3, in <module>
ld = ldap.initialize('ldap//localhost:389')
File
"/vol09/eng/python/python27/lib/python2.7/site-packages/ldap/functions.py",
line 91, in initialize
return LDAPObject(uri,trace_level,trace_file,trace_stack_limit)
File
"/vol09/eng/python/python27/lib/python2.7/site-packages/ldap/ldapobject.py",
line 70, in __init__
self._l =
ldap.functions._ldap_function_call(ldap._ldap_module_lock,_ldap.initialize,u
ri)
File
"/vol09/eng/python/python27/lib/python2.7/site-packages/ldap/functions.py",
line 63, in _ldap_function_call
result = func(*args,**kwargs)
ldap.LDAPError: (2, 'No such file or directory')
Any help to point me in the right direction would greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20110811/807c3288/attachment.html>
More information about the python-ldap
mailing list