Unexpected mod-python behaviour.

Bengt Richter bokr at oz.net
Fri Feb 6 13:45:06 EST 2004


On Wed, 4 Feb 2004 10:53:31 +0800, "Simon Wittber" <drconrad at 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



More information about the Python-list mailing list