[mod_python] test doesn't work

Gregory Trubetskoy grisha at modpython.org
Tue Jun 20 21:41:20 EST 2000


There is a module _apache which is only available from within
mod_python. However, if you comment out the 

from mod_python import apache

line, you should be able to import it from the command line.

I'm a little puzzled by this error, since everyone who has experienced it
never gave any logical reason as to what they did to fix this. It seems to
go away magically after they mes around for a while.

I am almost certain that this is caused by

1. a syntax error in test.py
2. a permissions problem

Grisha

On Tue, 20 Jun 2000, Howard Williams wrote:

> Hi
> 
> I've just installed the mod_python using all the latest source code for
> apache, python, and from the modpython.org site.
> 
> I can't seem to run the tester:  So I've seen some postings from last month
> about this with a similar "AttributeError: handler" title, but they didn't
> seem to apply.
> 
> When I run "python test.py" (which I'm not convinced is supposed to be
> possible) from a command line, I get the following output to stderr:
> ***********************************************************
> Traceback (innermost last):
>   File "test.py", line 1, in ?
>     from mod_python import apache
>   File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line
> 18, in ?
>     import _apache
> ImportError: No module named _apache
> 
> ***********************************************************
> 
> 
> My directories are laid out as follows:
> 
> /usr/local/lib/python1.5/site-packages/mod_python/apache.py
> /usr/local/lib/python1.5/site-packages/mod_python/apache.pyc
> /usr/local/lib/python1.5/site-packages/mod_python/cgihandler.py
> /usr/local/lib/python1.5/site-packages/mod_python/cgihandler.pyc
> /usr/local/lib/python1.5/site-packages/mod_python/httpdapi.py
> /usr/local/lib/python1.5/site-packages/mod_python/httpdapi.pyc
> /usr/local/lib/python1.5/site-packages/mod_python/zhandler.py
> /usr/local/lib/python1.5/site-packages/mod_python/zhandler.pyc
> 
> 
> I get this error:
> *********************************
> ERROR mod_python: "PythonHandler test"
> 
> Traceback (innermost last):
> 
>   File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line
> 96, in Dispatch
>     object = self.resolve_object(module, object_str)
> 
>   File "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line
> 42, in resolve_object
>     obj = getattr(obj, obj_str)
> 
> AttributeError: handler
> ************************************************
> 
> 
> Here's the apache error_log:
> ************************************************
> [Tue Jun 20 15:47:37 2000] [notice] Apache/1.3.12 (Unix) configured --
> resuming normal operations
> [Tue Jun 20 15:47:46 2000] [error] PythonHandler test: Traceback (innermost
> last):
> [Tue Jun 20 15:47:46 2000] [error] PythonHandler test:   File
> "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 96, in
> Dispatch
>     object = self.resolve_object(module, object_str)
> [Tue Jun 20 15:47:46 2000] [error] PythonHandler test:   File
> "/usr/local/lib/python1.5/site-packages/mod_python/apache.py", line 42, in
> resolve_object
>     obj = getattr(obj, obj_str)
> [Tue Jun 20 15:47:46 2000] [error] PythonHandler test: AttributeError:
> handler
> ************************************************
> 
> 
> 
>  Thanks for any help you can provide !!!!   :)
> 
> 
> HOWARD WILLIAMS
> marchFIRST
> 23422 Mill Creek Drive., Suite 100
> Laguna Hills, CA 92653
> ph: (949) 461-5480
> fax: (949) 461-5669
> howard.williams at marchFIRST.com
> www.marchFIRST.com
> 
> 




More information about the Mod_python mailing list