module ldap : no module named .py

Ron Teitelbaum Ron at USMedRec.com
Fri Jun 6 17:24:40 CEST 2008


Hi David,

 

I had this happen before because I tried to do this:

 

Import aModuleName.py

 

I don't see that mistake in your code though, but maybe something you are
calling is doing that.  You need to leave off the .py when doing import.

 

Hope that helps,

 

Ron

 

  _____  

From: python-ldap-dev-bounces at lists.sourceforge.net
[mailto:python-ldap-dev-bounces at lists.sourceforge.net] On Behalf Of David
Hlácik
Sent: Thursday, June 05, 2008 9:55 AM
To: python-ldap-dev at lists.sourceforge.net
Subject: Re: module ldap : no module named .py

 

As you can see :
Jun  5 13:33:12 dev01 nnrpd[9550]: python: Error: No module named py
comes from nnrpd_auth.py :

try:
                if
self.__newsauth(str(attributes['user']),str(attributes['pass'])): 
                        syslog('notice', 'authentication by username
succeeded')        
                        return ( self.authcodes['ALLOWED'], 'No error',
'default_user')
                else:
                        syslog('notice', 'authentication by username
failed')
                        return ( self.authcodes['DENIED'], 'Access Denied!')

        except Exception, e:
                syslog('notice', "Error: %s" % e)



On Thu, Jun 5, 2008 at 3:53 PM, David Hláčik <david at hlacik.eu> wrote:

FYI,

this is the result of test.py :
-- syslog level: notice message: nnrpd authentication class instance created
** set_auth_hook for <nnrpd_auth.AUTH instance at 0xb7f1f5ec>
-- syslog level: notice message: authentication module successfully hooked
into nnrpd
-- syslog level: notice message: nnrpd authentication class instance created
-- syslog level: notice message: n_a authenticate() invoked: hostname None,
ipaddress None, interface None, user boss
-- syslog level: notice message: authentication by username succeeded
(281, 'No error', 'default_user')

And this is the result (from news.notice) when used as auth hook in INN :
(inn will load nnrpd_auth.py and instantiate as in nnrpd_auth.py on the end
written and call method authenticate(attributes) ) :

Jun  5 13:33:12 dev01 nnrpd[9550]: david-nb.net.hlacik.eu (10.10.10.199)
connect
Jun  5 13:33:12 dev01 nnrpd[9550]: python interpreter initialized OK
Jun  5 13:33:12 dev01 nnrpd[9550]: python: nnrpd authentication class
instance created
Jun  5 13:33:12 dev01 nnrpd[9550]: python: authentication module
successfully hooked into nnrpd
Jun  5 13:33:12 dev01 nnrpd[9550]: python method authen_init not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python method authen_close not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python method access_init not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python method access_close not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python method dynamic_init not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python method dynamic_close not found
Jun  5 13:33:12 dev01 nnrpd[9550]: python: n_a authenticate() invoked:
hostname david-nb.net.hlacik.eu, ipaddress 10.10.10.199, interface
10.10.10.183, user boss
Jun  5 13:33:12 dev01 nnrpd[9550]: python: Error: No module named py
Jun  5 13:33:12 dev01 nnrpd[9550]: python authenticate method returned wrong
result
Jun  5 13:33:12 dev01 nnrpd[9550]: david-nb.net.hlacik.eu times user 0.016
system 0.016 idle 0.000 elapsed 0.073

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20080606/bab7c1af/attachment.html>


More information about the python-ldap mailing list