mod_python and the interpreter, no module _apache

Jeff talz13 at gmail.com
Sun Dec 5 17:09:02 EST 2004


Ok, so I'm working on a project right now that is being done in psp
through apache.  This is working fine, except that in every one of my
modules I had to use the mod_python function of apache.import_module
for its autoreload capability.

Now I cannot open or run any of my classes in the interpreter without
getting a "No module named _apache" error.  I need to get this
working, as I am without unittesting right now.

I also tried making my unit test into a psp page, but then I get an
error about:

================================================================================
Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "/usr/local/stow/Python-2.3.4/lib/python2.3/site-packages/mod_python/apache.py",
line 299, in HandlerDispatch
    result = object(req)

  File "/usr/local/stow/Python-2.3.4/lib/python2.3/site-packages/mod_python/psp.py",
line 297, in handler
    p.run()

  File "/usr/local/stow/Python-2.3.4/lib/python2.3/site-packages/mod_python/psp.py",
line 208, in run
    exec code in global_scope

  File "/export/eecs/htdocs/eecs3550/team1/proj/lib/unittests/testRequestContainer.psp",
line 77, in ?
    unittest.main()

  File "/usr/local/stow/Python-2.3.4/lib/python2.3/unittest.py", line
714, in __init__
    argv = sys.argv

AttributeError: 'module' object has no attribute 'argv'
================================================================================

So that doesn't seem to work right for what I want either.

Does anybody know of a way to get both of these to coexist peacefully?



More information about the Python-list mailing list