Any volunteers for SF#1657848?

Michael Ströder michael at stroeder.com
Thu Mar 22 20:48:40 CET 2007


David Leonard wrote:
>  here's my hackery so far.. doesn't seem to work completely though...

David, glad to here from you!
Even more glad to receive some code for python-ldap!

> this is how I test:
> $ python setup.py build
> $ PYTHONPATH=build/lib.openbsd-4.0-i386-2.3/ python -c 'import _ldap;
> print _ldap.dn2str(_ldap.str2dn("a=b,c=d;e=f"))'

1. Do we really need to expose OpenLDAP constants LDAP_DN_* etc. you
introduced in constants.c at the python-ldap's API? I'd rather vote to
through out some already existing constants since they are not needed
for Python applications.
For the ease of maintenance I'd like to keep the C part under Modules/
as sparse as possible.

2. The new functions:

>>> import _ldap
>>> _ldap.str2dn('cn=Michael Ströder,o=Blurb\, Co.')
[[('cn', 'Michael Str\xc3\xb6der', 4)], [('o', 'Blurb, Co.', 1)]]

What are the numbers? Some flags in an integer?

Further trails with dn2str():

>>> print _ldap.dn2str([[('cn', 'Michael Str\xc3\xb6der', 4)], [('o',
'Blurb, Co.', 1)]])
Modules/functions.c:160
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes exactly 1 argument (3 given)
>>> print _ldap.dn2str([[('cn', 'Michael Str\xc3\xb6der')], [('o',
'Blurb, Co.')]])
Modules/functions.c:160
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function takes exactly 1 argument (2 given)
>>> print _ldap.dn2str([[('cn=Michael Str\xc3\xb6der')], [('o=Blurb,
Co.')]])
Modules/functions.c:160
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: new style getargs format but argument is not a tuple
>>> print _ldap.dn2str([['cn=Michael Str\xc3\xb6der'], ['o=Blurb, Co.']])
Modules/functions.c:160
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: new style getargs format but argument is not a tuple
>>> print _ldap.dn2str(['cn=Michael Str\xc3\xb6der','o=Blurb, Co.'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ("expected seq of seq of '2+'-seq", ['cn=Michael
Str\xc3\xb6der', 'o=Blurb, Co.'])
>>>

???????

> ps - my mails to the dev list don't seem to be getting through .. i'll
> have to look at that :)

I had this also (see below). Maybe my provider fixed it...

<python-ldap-dev at lists.sourceforge.net>: host
    mail.sourceforge.net[66.35.250.206] said:
550-Callback setup failed while
    verifying <michael at stroeder.com>
550-Called:   81.169.145.100 550-Sent:
    MAIL FROM:<>
550-Response: 503 5.1.8 Postmaster not allowed
550-The initial connection, or a HELO or MAIL FROM:<> command was
550-rejected. Refusing MAIL FROM:<> does not help fight spam, disregards
550-RFC requirements, and stops you from receiving standard bounce
550-messages. This host does not accept mail from domains whose servers
550-refuse bounces. 550 Sender verify failed (in reply to RCPT TO  command)

Ciao, Michael.



More information about the python-ldap mailing list