[mod_python] __init__ not called

Graham Dumpleton grahamd at dscpl.com.au
Thu Aug 10 06:12:25 EDT 2006


On 10/08/2006, at 7:51 PM, Graham Dumpleton wrote:

>
> On 10/08/2006, at 5:32 PM, Alex Greif wrote:
>
>> Hi,
>>
>> Inside of the apache installation folder I have a directory "scripts"
>> where all my handler modules reside.
>> I placed a __init__.py in the this folder, but my tests showed that
>> the __init__.py is never processed, and a pyc file is not generated
>> either. But Why?
>> in subpackages all the __init__ files are processed as expected.
>>
>> Is my "scripts" folder not a regular python package, despite it is
>> added to the sys.path?
>
> Which version of mod_python are you using and are you using the
> mod_python.publisher handler?

Having thought more about what you are asking, first thing is that  
you aren't
getting .pyc files as Apache runs as a user which most likely doesn't  
have
write permission on the directories. Second is that even when using  
Python
outside of mod_python, it will not read an __init__.py file which is  
immediately
in the directory specified in sys.path, it will only do it for  
packages residing
in subdirectories. You might want to review how Python works in that
respect.

Graham


More information about the Mod_python mailing list