I'm on the list so no need to cc: me with your reply...
On Wednesday 30 June 2004 09:29 am, you wrote:
> Greg Fortune wrote:
> > I fought with the python-ldap module last night, but couldn't get it to
> > behave properly. It would import when working on the command line or
> > through PythonWin, but refused to import through ASP/IIS. I would get a
> > module not found error message.
>
> Please post a complete traceback.
##############
Without any ldap module installed on the ASP page.
=2D----------------------------------------------------
Traceback: File "", line 7, in ?=20
exceptions.ImportError: No module named ldap
=2D----------------------------------------------------
=46rom the command line, import ldap gives
>>> import ldap
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ldap
###############
After copying the contents of the zip file into the site-packages directory.
=2D----------------------------------------------------
Traceback: File "", line 7, in ?=20
exceptions.ImportError: No module named ldap
=2D----------------------------------------------------
=46rom the command line, it imports successfully.
################
After deleting the necessary files and installing via the .exe, the import =
is=20
successful from both the command line and ASP.
Python version:
2.3.2 (#49, Nov 13 2003, 10:34:54) [MSC v.1200 32 bit (Intel)]
I wrapped the traceback to make sure we were getting a full traceback as it=
=20
didn't look terribly helpful. The code on that page is as follows:
<%@ LANGUAGE=3D"Python" %>
<html>
<head></head>
<body>
<%
import sys
if(Server.MapPath('/admin/libs') not in sys.path):
sys.path.append(Server.MapPath('/admin/libs'))
=09
Response.write(str(sys.version) + '<br>')
try:
import ldap
except ImportError, err:
(t, val, tb) =3D sys.exc_info()
import traceback
msg =3D '-----------------------------------------------------<br>'
msg +=3D 'Traceback:\n'
msg +=3D '<br>'.join(traceback.format_tb(tb)) + '<br>'
msg +=3D '%s: %s<br>' % (t, val)
msg +=3D '-----------------------------------------------------<br>'
Response.write(msg)
=09
>
> > This morning, I tried the .exe installer from Mauro
> > (python-ldap-2.0.0pre14.win32-py2.3.exe) and it worked like a charm.
>
> Very often I had seg faults when using it with standard Python 2.3.3.
This is with ActivePython, but it might have the same problem :( I've used=
=20
ldap with=20
Python 2.3.3 (#1, May 25 2004, 08:52:15)
[GCC 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)] on linux2
and it seems to work fine. I'll watch for the segfaults...
Greg Fortune
|