R: [mod_python] Serius problem in mod_python-3.2.2b

Manera, Villiam vmanera at manord.com
Wed Oct 19 06:04:58 EDT 2005

Is not a import problem, I have now tried the workaround from Graham Dumpleton: 

name = os.path.splitext(os.path.split(__file__)[1])[0]  instead __name__ and it work fine.

I use __name__ inside my appplications not for import scope, but for check autentication of module and so on...

I this will be the new behaviour I may fix all my programs (375) that used  __name__ 

May I start to fix my programs with  os.path.splitext(os.path.split(__file__)[1])[0]  instead __name__  ? 


 -----Messaggio originale-----
Da: Nicolas Lehuen [mailto:nicolas.lehuen at gmail.com] 
Inviato: mercoledì 19 ottobre 2005 11.05
A: Manera, Villiam
Cc: mod_python at modpython.org
Oggetto: Re: [mod_python] Serius problem in mod_python-3.2.2b

	No, it's not a bug, it's a feature. In the new publisher, published module are no longer stored in sys.modules and the __name__ attribute of the module is based on the filename.
	Why is this a problem to you ? Giving the published module a simpler name is not that complicated, but I need to understand why it's important. Especially, if it is because you expect to be able to import the module by name from another module, tell me because things will change in the future mod_python releases.
	2005/10/19, Manera, Villiam <vmanera at manord.com>: 

		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
		Why mod python change the python variable __name__ ?????
		I hope this is a bug 
		Mod_python mailing list
		Mod_python at modpython.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051019/48b287e8/attachment.html

More information about the Mod_python mailing list