[mod_python] PSP strcache error

techead at technetos.com techead at technetos.com
Mon May 17 18:16:37 EDT 2004


I was fighting the strcache.get() error in the PSP modules recently 
and decided it might be a bug in the psp.py module of mod_python.  
Grisha confirmed this and said that it will be fixed in the next 
release.

In the mean time I made enough modifications to get it working for me 
so that I could use mem_scache.  Here is a diff output of the changes 
I made if anyone else is interested:

#diff psp.py.org psp.py
114c114
<             cached = strcache.get(string)
---
>             cached = mem_scache.get(string)
118,119c118,119
<                 self.code = _psp.parsestring(string)
<                 strcache.store(string)
---
>                 mem_scache.store(string,_psp.parsestring(string))
>                 self.code = mem_scache.get(string)
355c355,356
<         self.cache[key] = (1, val)
---
>         code = compile(val, "<string>", "exec")
>         self.cache[key] = (1, code)
361c362
<             hist, val = self.cache[key]
---
>             hits, code = self.cache[key]
363c364
<             return val
---
>             return code



More information about the Mod_python mailing list