[mod_python] mod_python gone pyc'ed on me!

Jorey Bump list at joreybump.com
Sun Mar 12 00:09:27 EST 2006

marinus van aswegen wrote:
> Somthing very strange just happened to me. I'm busy writing some 
> additional functions to call from the browser when all of a sudden I 
> noticed that when I requested my function ala 
> https://localhost/cmd/index <https://localhost/cmd/index> that my url 
> was rewritten in the error as https://localhost/cmd.pyc/index strange! 
> everything was working for all of a sudden I see .pyc in my www dir? I 
> can't get to my function, eek!
> my httpd.conf is as follow
> <Directory "/opt/www">
>     # handle .py files
>     AddHandler mod_python .py
>     PythonHandler mod_python.publisher
>     PythonDebug On
> </Directory>
> Apache/2.0.54 (Ubuntu) mod_auth_kerb/5.0-rc6 mod_python/3.1.3 
> Python/2.4.2 mod_ssl/2.0.54 OpenSSL/0.9.7g

Do you have MultiViews enabled? You may want to turn it off. If not, 
remove all .pyc files and set the permissions on the directory so that 
the user Apache runs as does not have write access. That will prevent 
the Python interpreter from opportunistically creating .pyc files.

More information about the Mod_python mailing list