[mod_python] global var on 2.7

Jorey Bump list at joreybump.com
Sun Jul 10 15:02:38 EDT 2005

Nicolas Lehuen wrote:
> By all means let's archive this thread, for it contains this paragraph :
>  > Then this should work, but be aware that if your bigdic is truly
>  > enormous, you should tuck it away and only use it when needed. Excessive
>  > handling of bigdic could result in a huge load and bring your system to
>  > exhaustion.
> THIS is some seriously technical stuff that should only be told in 
> private circles ;).

BTW, I forgot to mention that mod_python.publisher makes certain 
toplevel objects callable, so the code you provided below contains a 
security risk where you reassign your object (retaining dotted notation 
in your published modules can protect you from a number of ills):

> 2005/7/10, antoine <rouadec at gmail.com <mailto:rouadec at gmail.com>>:
>> and call this from index.py with
>> import CacheBigdic
>> bigdic = CacheBigdic.getBigdic()
>> def index(req):
>>   ...
>>   use(bigdic)
>>   ...

You could get into a lot of trouble exposing your bigdic to the public.

More information about the Mod_python mailing list