[Tutor] LDAP search with ldap library module failing
Antonio de la Fuente
tonifuente at yahoo.co.uk
Tue Aug 6 12:01:59 CEST 2013
* Dave Angel <davea at davea.name> [2013-08-05 12:16:58 +0000]:
> > * Dominik George <nik at naturalnet.de> [2013-08-05 12:45:42 +0200]:
> <snip>
> >
> >> > The error message is: ('EOF in multi-line statement', (379, 0))
> >>
> >> > --> 519 return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout)
> >>
> >> This is why I say "never use ipython". The error message is complete
> >> non-sense.
> >>
> >
> > I will also try with IDLE.
>
> Consider using the shell window and just running python. it seems like
> every IDE or pseudo-IDE tries to be helpful, and frequently misses the
> mark. The terminal will show you the unmodified traceback,
>
> I'm not saying never use an IDE. A good one is very useful for certain
> things.
>
> But when it interferes with the job, run without it.
>
It seems all it was to blame is my impatience :-/
On the LDAP server I've run tcpdump catching anything that came from the
server were I am running the script, source IP:
# tcpdump -vvv src [IP address]
I wrote the python statements on a file and I've run it on the bash
shell. I've also changed the LDAP object search so I didn't include a
timeout argument, as I could see that when running the search, there was
periods of up to 30 seconds where the connection was idle, tcpdump
didn't spit anything:
ld.search_s(ldapBase,ldap.SCOPE_SUBTREE,'(&(objectclass=dnszone)(cn=*))',['dnszonename','modifytimestamp'])
After around 10 minutes there were the expected results.
Then I tried with iPython and IDLE, both of then also gave me the
expected result.
Thank you.
--
Toni
Más vale una palabra a tiempo que cien a destiempo.
-- Miguel de Cervantes Saavedra. (1547-1616) Escritor español.
More information about the Tutor
mailing list