R: R: [mod_python] Servlet Loading problem 1 year later

Graham Dumpleton grahamd at dscpl.com.au
Tue May 23 07:09:13 EDT 2006


On 23/05/2006, at 8:15 PM, Manera, Villiam wrote:

> I don't use apache.import_module() in any of my own modules.
> The problem arise in developer (linux:RH3 EL mod_python 3.2.8)
> And in the production          (linux:RH3 EL mod_python 3.1.5)
>
> If I right understand the article only in mod_python 3.2.8 the new
> module loding is in place.
>
> Villiam

If you are specifying:

   PythonHandler mod_python.servlet

or:

   PythonHandler servlet

if you put the mpservlets code in your handler directory, then you are.

This is because the PythonHandler directive uses "apache.import_module 
()".

All it then takes to cause problems is for you to use:

   import mod_python.servlet
   from mod_python import servlet

or:

   import servlet

depending on whether mpservlets installed centrally or in handler  
directory.

If this is the case, you might solve the problem by using  
"apache.import_module()"
to import "mod_python.servlet" etc.

Graham

> On 22/05/2006 at 22:56 Graham Dumpleton wrote:
>
>> Please keep followups on list.
>
>> You don't need to actually touch servlet.py to get problems if you
> happen to be using "import" and "apache.import_module ()" on the same
> module at different times. This is because of an issue in the  
> mod_python
> importer. See:
>
>>
> http://www.dscpl.com.au/articles/modpython-003.html#redundant- 
> module-loa
> ding
>
>> Sorry for quick reply, in a rush. I'll try and comment later on the
> whole issue of checking subclass types and caching.
>
>> Graham
>
> On 22/05/2006, at 11:06 PM, Manera, Villiam wrote:
>
>> Yes, i knows that it could be happened if I touch servlet.py becouse
>> Daniel Popowiwich told me 1 year ago.
>>
>> ....



More information about the Mod_python mailing list