[mod_python] ldap woes

mauchi mauchi at assembleco.com
Fri Aug 11 01:35:30 EDT 2006

I am able to authenticate users under MoinMoin with python ldap as well
as command line on the same server using the following mechanism:


import ldap

ldapServer = ''
ldapConfig = 'uid=%s,ou=people,dc=assembleco,dc=x'

l = ldap.open(ldapServer)

if password == "":
	password = "wrong"

	l.simple_bind_s(ldapConfig % ('%s'%username), ('%s'%password))
except ldap.LDAPError, e:
	print e


Under mod_python, it fails with the following error:

{'desc': 'Encoding error'}

any ideas as to why it would act this way just with mod_python? 


(o) 510.524.8255 x801
(c) 510.435.9145

text page to 5104359145 at vtext.com

More information about the Mod_python mailing list