On Thu, 7 Sep 2000, mike typed thusly:
> My apoligies, the following two questions are pretty simple but I
> couldn't figure either of them out.
actually, neither are simple!
> First, the .tex files in the Doc/_ldap directory are giving me errors
> when I try to view them(using latex or tex), is anyone else having this
> problem?
yes... currently they need the tex support files from the recent
betas of python 1.6.. I have been able to build the documentation,
but want to do so in an automated/reliable way on the sourceforge boxes.
Eventually it will be put on the web site.
> Second, the reason I needed to look at the docs was to see what
> paramaters are supposed to be supplied to modify_s. I did use vi to
> look at the raw .tex file and found my answer but it still doesn't seem
You can look at the __doc__ members on the functions. They are
generally up to date.
> to be working. Below is a test file that I am using along with the
> error it generates.
>
> Once again my apologies for the simple questions, the error is probably
> some bad syntax on my part, but I can't tell for sure because I can't
> read the docs. Thanks again for any help!
>
> [Contents of file test.py]
>
> #!/usr/bin/env python
>
> import _ldap
>
> l = _ldap.open("localhost")
> l.simple_bind_s("","")
> tmp = _ldap.MOD_REPLACE, "favoritecolor", "red"
> l.modify_s("cn=mike, ou=People, dc=foo, dc=com",tmp)
> l.unbind()
>
>
> [Results when I run it]
>
> [mike@apache mike]$ ./test.py
> Traceback (innermost last):
> File "./test.py", line 8, in ?
> l.modify_s("cn=mike, ou=People, dc=foo, dc=com",tmp)
> SystemError: new style getargs format but argument is not a tuple
that's a strange error! what you needed was a list of tuples:
l.modify_s("cn=mike, ou=People, dc=foo, dc=com", [tmp])
Also, you ought to be using 'ldap', instead of '_ldap' :)
By the way, for other people reading, the SystemError came from
the Tuple_to_LDAPMod() function; its because I was lazy and used
PyArg_ParseTuple to split up the 'tuple' without checking that it
actually was a tuple.
I've added a check now and will eventually commit it. The error you
would get after the patch would be:
TypeError: ("expected a tuple", 2)
which would probably not help, unless you knew that MOD_REPLACE = 2.
> _______________________________________________
> Python-LDAP-dev mailing list
> Pyt...@li...
> http://lists.sourceforge.net/mailman/listinfo/python-ldap-dev
>
--
David Leonard Dav...@cs...
Dept of Comp. Sci. and Elec. Engg _ Room:78-640 Ph:+61 7 336 51187
The University of Queensland |+| http://www.csee.uq.edu.au/~leonard/
QLD 4072 AUSTRALIA ~` '~ B73CD65FBEF4C089B79A8EBADF1A932F13EA0FC8
No horse gets anywhere until he is harnessed. No stream or gas drives anything
until it is confined. No Niagara is ever turned into light and power until
it is tunneled. No life ever grows great until it is focused, dedicated,
disciplined. -Harry Emerson Fosdick
|