patch to compile with OpenLDAP 2.0.7

David Leonard david.leonard at dstc.edu.au
Fri Nov 17 15:34:54 CET 2000


Hi everyone. I'm in germany at the moment

hey these patches look ok

i have a medium concern, something that i've been guilty of and would like to
see go away, and that is conditional existance of interfaces.

eg  ufn_search_s() might be #ifdef'd out and some python program that wants
to use it will get a NameError when it tries to use it. A better exception
would be NotImplementedError.

ie instead of writing

	#ifdef LDAP_API_THING
	ldap_ufn_search_s(PyObject blah, blah) {
		blah;
	}
	#endif

it ought to be

	ldap_ufn_search_s(PyObject blah, blah) {
	#ifdef LDAP_API_THING
		blah;
	#else
		return Py_ErrObject(Py_NotImplementeError);
	#endif
	}

A similar problem arises with 'constants'.. I'm not sure what to do here..
make all undefined cosntants equal None?

also there should be some nice way of reliably determining the
underlying library's api version ... maybe _ldap.api_version...
any suggestions on how that might be done nicely are welcome.

tschuss!

d

On Fri, 17 Nov 2000, Konstantin Chuguev typed thusly:

> Hello Jeffrey and all.
>
> Attached are recent version of my patches, if you are interested. They
> provide the following:
>
>    * automatic recognition of OpenLDAP-1.2.x or OpenLDAP-2.0.x at compilation
>      time, building different sets of Python LDAP constants and error
>      exception objects for different OpenLDAP versions;
>    * special tuples for continuation references: (None, [list_of_URLs]).
>      Compare to normal entry tuples: (DN, {dict_of_attributes}). Both types
>      of tuples can be returned from search methods;
>    * new type of result type in the result method: SEARCH_REFERENCE.
>    * a few new ldap object attributes, among them: referrals - disables (0)
>      or enables (1) following referrals; is set to 1 after ldap object
>      initialisation; version (2 or 3) - sets LDAP protocol version (default
>      is 2).
>
> Any comments/suggestions/fixes are welcome.
>
>
> Regards,
>     Konstantin.
>
> "Jeffrey C. Ollie" wrote:
>
> > On Thu, Nov 16, 2000 at 11:55:57PM +0100, Michael Ströder wrote:
> > > "Jeffrey C. Ollie" wrote:
> > > >
> > > > I've gotten today's CVS version to compile against OpenLDAP 2.0.7.
> > >
> > > Ooops. Double efforts. I'm currently testing patches by Konstantin
> > > (Cc:-ed) which also allow to retrieve search continuation references
> > > (LDAPv3 referrals).
> > >
> > > He made some changes to attributes of LDAPObject. Especially setting
> > > the options is different.
> >
> > I didn't know that anyone else was working on it...  The list has been
> > quiet for some time now.  It looks like Konstantin's work goes beyond
> > what I intended to accomplish.  I wasn't looking to add any
> > functionality, just to get python-ldap to compile and work.  But I'd
> > be happy to test out other patches and perhaps fix a bug or two.
> >
> > Jeff
> >
> >   


More information about the python-ldap mailing list