By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

Unexpected mod-python behaviour.

P: n/a
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?
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 4 Feb 2004 10:53:31 +0800, "Simon Wittber" <dr******@metaplay.com.au> wrote:
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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.