[mod_python] Documentation inconsistency in 3.0.1 docs

Matthew J. Probst matthew at yak.org
Thu Feb 13 19:43:01 EST 2003


Since I'm a complete newbie at mod_python, I thought I'd share the results 
of my head-banging against the documentation.

In Section 3.4 (Now something More Complicated) the sample code says

..
..
def authenhandler(req):
   user = req.user
   pw = req.get_basic_auth_pw()
..
..

This snip of code failed to authenticate because req.get_basic_auth_pw() 
needs to be called -before_ doing anything with the user.  I found this out 
by looking in section 5.1.7, which clearly states this.  However, section 
5.1.7 incorrectly states that you get user from req.connection.user instead 
of req.user.

This stuff might be obvious to someone who moved from mod_python 2.x to 3.x 
but since I'm new it didn't make sense for a while.  So section 3.4 and 
5.1.7 need changing,  _or_ (less likely) there's a lurking bug somewhere.




More information about the Mod_python mailing list