[mod_python] Reload problem - again!

Ole Hansen dsl45393 at vip.cybercity.dk
Mon Oct 15 23:59:41 EST 2001


Hi,

I still have a reload problem when using mod_python. From the error_log below 
it can be seen (last line) that apache searches for a file called 'myfile.p'. 
What happend to the last 'y' in '.py' ?

I'm still using my homemade workaround, but I'm not sure this is the right 
way to do it. I'm using python 2.2.1 and I have just installed mod_python 
2.7.6 and apache 1.3.20, but the reload problem is still there. Is this 
really only a problem on my system?

My homemade workaround in apache.py (line 356,359) is as follows:

            # check also .py and take the newest
            ## if os.path.exists(filepath[:-1]) :
            if os.path.exists(filepath[:]):

                # get the time of the .py file
                ## mod = os.stat(filepath[:-1])
                mod = os.stat(filepath[:])
                mtime = max(mtime, mod[stat.ST_MTIME])


In filepath[:-1] I have just removed '-1'. Well, it works for me at the 
moment, but I'm afraid that someday nothing will work because of this 
modification. Could there be something else wrong with my configuration? If 
anybody have an idea I'm happy to hear about it.

Thanks in advance!
Br.
Ole Hansen


error_log: (with original apache.py)
----------------------------------------
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher: 
Traceback (most recent call last):
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher:   File 
"/usr/local/lib/python2.1/site-packages/mod_python/apache.py", line 193, in 
Dispatch
    result = object(req)
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher:   File 
"/usr/local/lib/python2.1/site-packages/mod_python/publisher.py", line 128, 
in handler
    module = apache.import_module(module_name, _req, [path])
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher:   File 
"/usr/local/lib/python2.1/site-packages/mod_python/apache.py", line 356, in 
import_module
    if os.path.exists(filepath[:-1]) :
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher:   File 
"/usr/local/lib/python2.1/posixpath.py", line 171, in exists
    st = os.stat(path)
[Mon Oct 15 22:49:15 2001] [error] PythonHandler mod_python.publisher: 
OSError: [Errno 2] No such file or directory:
'/usr/local/apache/htdocs/myfile.p'



More information about the Mod_python mailing list