473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Python LDAP

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
2 6459
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Micha³ Kurowski | last post by:
Hi, I'd like to ask you whether anyone have built python-ldap against Sun ONE Directory v5.2 on a Solaris 9. Seems developers do not support such config, but many places on the web suggest it...
1
by: Brian Beck | last post by:
As far as I can tell, both maintainers of the Windows builds of Python-LDAP haven't updated in about a year. This doesn't exactly make the builds ancient or obsolete, but it would be nice to start...
1
by: rcmn | last post by:
i'm running around in circle trying to to use python/ldap/ on win32(WinXP). I want to write a script that read SQL data(no pbm) and insert member in a AD group(pbm).I used the module...
5
by: Melissa Evans | last post by:
Hi. I'm new to Python. :) I've modified grappy.py, http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy daemon for greylisting. to use LDAP as a backend instead of SQL (with...
1
by: Nico Grubert | last post by:
Hi there, on a linux machine I am running this ldapsearch from the command line: ldapsearch -x -h myldaphost.mydomain.com \ -D "CN=ldapuser,CN=Users,DC=mydomain,DC=com" -w "secret" \ -b...
0
by: sbartz | last post by:
Greetings, My ldap application relies on user input for a ldap server uri, so I am looking for a way to use the ldap api to determine whether the ldap server is up or not. All the docs have to...
10
by: Benedict Verheyen | last post by:
Hi, i found python-ldap for version Python 2.4. Is there i place i can find a version for 2.5? If not, how can i build it myself for Windows? Thanks, Benedict
6
by: hotani | last post by:
I am attempting to pull info from an LDAP server (Active Directory), but cannot specify an OU. In other words, I need to search users in all OU's, not a specific one. Here is what works: con...
1
by: Erick Perez - Quadrian Enterprises, S.A. | last post by:
Hi, I have a MS Windows AD domain, and have one OU with more tan 1000 users objects. When I try to read it, I hit the 1000 limit of AD while returning objects, so I'm asking for advice as to how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.