[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-ldap-dev
Subject:    Re: Possible bug in simple_bind()
From:       Wido Depping <wido.depping () gmail ! com>
Date:       2005-09-20 5:03:24
Message-ID: 127079e105091922036b3b632d () mail ! gmail ! com
[Download RAW message or body]

On 9/19/05, Mark Roach <mrroach@okmaybe.com> wrote:
> On Thu, Sep 15, 2005 at 04:41:45PM +0200, Wido Depping wrote:
> > Hi All,
> > I've run accross a strange behaviour with simple_bind(). Instead of
> > throwing exceptions when a bind wasn't succesful, it returns an
> > integer. 4 for failure and 5 for success. Unfortunately I was assuming
> > that this function would raise an exception. simple_bind_s() however
> > behaves 'correctly'. Is this behaviour correct or a bug?
> 
> simple_bind is asynchronous, meaning that you need to take the number it
> returns and pass it to result(). That's when it will raise the exception

> The reason it works with the _s version of the function is that all the
> _s functions are synchronous, i.e. they are the same as calling
> c.result(c.function(params...)). Depending on the way your app is
> architected, either one may be apropriate.

Argh, shame on me. Somehow this was too obvious. I was distracted
because of the unbind()/unbind_s() functions, where it's stated in the
docs, that they are both synchronous ^^

mfg.
  Wido
-- 
Wido Depping
ICQ: 51303067    AIM: wido3379
Jabber: wido@jabber.ccc.de


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic