By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

Python LDAP

P: n/a
Hi

I am trying to make a simple Python script using LDAP. The module is
imported OK, but when I call the function open or initialize, I get
this error:

Traceback (most recent call last):
File "/home/juan/workspace/amquare/src/nutum/amquare/amquare.py",
line 122, in <module>
conn.connect()
File "/home/juan/workspace/amquare/src/nutum/amquare/ldap_util.py",
line 39, in connect
self.conn = ldap.initialize(self.host, self.port)
File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 87,
in initialize
return LDAPObject(uri,trace_level,trace_file,trace_stack_ limit)
File "/usr/lib/python2.5/site-packages/ldap/ldapobject.py", line 70,
in __init__
self._l = ldap.functions._ldap_function_call(_ldap.initializ e,uri)
File "/usr/lib/python2.5/site-packages/ldap/functions.py", line 59,
in _ldap_function_call
result = func(*args,**kwargs)
LDAPError: (2, 'No such file or directory')

What file is not found? I have lots of searches but don't get any
answer. Anyone know how to solve this?

Thanks in advance.
Aug 26 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Juan wrote:
self.conn = ldap.initialize(self.host, self.port)
[..]
LDAPError: (2, 'No such file or directory')
You have to pass in a LDAP URI as documented here:
http://python-ldap.sourceforge.net/d...dap.initialize

Use of compability function ldap.open() is deprecated and might vanish
in future versions of python-ldap.

See also Demo/initialize.py in python-ldap's source distribution.

Ciao, Michael.
Aug 26 '08 #2

P: n/a
On 26 ago, 13:42, Michael Ströder <mich...@stroeder.comwrote:
Juan wrote:
* * self.conn = ldap.initialize(self.host, self.port)
*[..]
LDAPError: (2, 'No such file or directory')

You have to pass in a LDAP URI as documented here:http://python-ldap.sourceforge.net/d...dap.initialize

Use of compability function ldap.open() is deprecated and might vanish
in future versions of python-ldap.

See also Demo/initialize.py in python-ldap's source distribution.

Ciao, Michael.
Perfect! Thank you very much.
Aug 26 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.