[mod_python] Serius problem in mod_python-3.2.2b

Graham Dumpleton grahamd at dscpl.com.au
Wed Oct 19 05:08:32 EDT 2005


On 19/10/2005, at 6:45 PM, Manera, Villiam wrote:

> I Installed the beta from mod_python-3.2.2b.win32-py2.4.exe
> Apache has started well
>
> In my login program, the first checked, I use the python variable
> __name__  and this is the problem:
>
> In early mod_python version the value was as
> expetded:-->cgi-mpy_login<---Module name
>
> In this beta:-->D_discoE_script_cgi_cgi_mpy_cgi_mpy_login_py <--- 
> Module
> name
>
> Why mod python change the python variable __name__ ?????
>
> I hope this is a bug

No it isn't a bug. It is a result of first steps towards fixing a whole
lot of problems with the module loading system in mod_python.
See the following link for a list of known issues in mod_python < 3.2.

   http://www.dscpl.com.au/articles/modpython-003.html

In 3.2, mod_python.publisher no longer uses the standard Python
module importing system as a result of the changes made so far.

You can get the same result as what you want by using:

   import os
   name = os.path.splitext(os.path.split(__file__)[1])[0]

This will work for mod_python < 3.2 as well.

Graham


More information about the Mod_python mailing list