Unexpected mod-python behaviour.

S

Simon Wittber

Greetings fellow Python People!

I am using the latest debian-unstable Apache 1.3 and mod-python 2.7 with
python 2.3.3

Yesterday I wrote a small mod-python script which returned the URL
entered as a XML snippet.

This morning, I created a new directory, and copied this script and
..htaccess file across to a new directory, and changed the program to
return a list of tables and fields in a MySQL table.

I was making good progress, things were working great. Then I hit
refresh (Ctrl-R), _twice_, in Mozilla, and lo-and-behold, I received an
XML snippet of the URL. The program I wrote _yesterday_ appeared to be
running instead of my current work! This is *not* a caching problem, as
I am able type in different URL's and receive the correct XML snippet
back in the browser.

I am not importing modules, I am writing all my code in the handler.py
file, which is pointed at by my .htaccess file, so this is not a module
reloading problem.

This is extremely bizarre behaviour, and I am unable to track down the
problem. The only solution is to restart apache, which is unacceptable.
What if this happened in a production environment?

Can anyone explain this weirdness?
 
B

Bengt Richter

Greetings fellow Python People!

I am using the latest debian-unstable Apache 1.3 and mod-python 2.7 with
python 2.3.3

Yesterday I wrote a small mod-python script which returned the URL
entered as a XML snippet.

This morning, I created a new directory, and copied this script and
.htaccess file across to a new directory, and changed the program to
return a list of tables and fields in a MySQL table.

I was making good progress, things were working great. Then I hit
refresh (Ctrl-R), _twice_, in Mozilla, and lo-and-behold, I received an
XML snippet of the URL. The program I wrote _yesterday_ appeared to be
running instead of my current work! This is *not* a caching problem, as
I am able type in different URL's and receive the correct XML snippet
back in the browser.

I am not importing modules, I am writing all my code in the handler.py
file, which is pointed at by my .htaccess file, so this is not a module
reloading problem.

This is extremely bizarre behaviour, and I am unable to track down the
problem. The only solution is to restart apache, which is unacceptable.
What if this happened in a production environment?

Can anyone explain this weirdness?
Is it possibly executing the .pyc compiled from the previous version for
some reason? What are the paths etc. involved in accessing .py and .pyc?
(or .pyo, if that's involved). What is the default directory when it runs?

Regards,
Bengt Richter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top