|
From: Jens V. <je...@zo...> - 2002-01-28 19:14:36
|
actually it does not work well in the latest python-ldap. importing = _ldap=20 will not raise an ImportError. but _ldap is crippled and will blow up = the=20 first time you try to call something with it. everywhere i go on the python-ldap.sourceforge.net site the docs talk of=20= the "_ldap" module and code examples use "import _ldap". that's probably=20= why i assumed that that's the canonical way of doing things. i'm just wondering why in the world that's deprecated now and importing=20= ldap is the only way it works. jens On Monday, January 28, 2002, at 01:52 , Peeyush Garg wrote: > As I see it in the latest code, I think both shud work.... > > try: > import _ldap > except ImportError: > import ldap > _ldap =3D ldap > > Except I couldn't still get it running either way on Unix but runs=20 > perfectly > on Windows even though it installs correctly on Unix. I tried Zope = mailing > list too. No luck. > > ~Peeyush. > > ----- Original Message ----- > From: "Jens Vagelpohl" <je...@zo...> > To: <mi...@st...> > Cc: "python-ldap-dev" <pyt...@li...> > Sent: Monday, January 28, 2002 7:57 AM > Subject: Re: why didn't it work? > > > i'm very surprised. i was under the impression that it was just the = other > way around: importing _ldap was the canonical way and importing ldap = only > existed for backwards compatibility. > > i'm confused. > > jens > > > On Monday, January 28, 2002, at 10:29 , Michael Str=F6der wrote: > >> Jens Vagelpohl wrote: >>> >>> i'm getting complaints about this from people who use some of my=20 >>> products >>> that rely on python-ldap. one guy uses a CVS checkout from january = 4th. >>> is >>> the CVS version hosed? >> >> Don't import _ldap. Despite some code examples this was never good >> practice. >> >>> if I try to call the "_ldap.open" function, it fails : >>> module _ldap does not have such function. >> >> Yes. >> >>>>>> can you import "ldap"? >>> Yes, I can, and I can call functions "ldap.open", "ldap.bind_s", = etc. >>> ******* >> >> There's no reason to import _ldap. Don't do that. Everything's >> wrapped correctly in module ldap.ldapobject. >> >> Ciao, Michael. > > > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev > > > _______________________________________________ > Python-LDAP-dev mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-ldap-dev |