Mod Python Question

Daniel Nogradi nogradi at gmail.com
Tue May 8 18:07:38 EDT 2007


> I am very new to Python and Mod_Python and I am running into what
> looks like a caching problem.
>
> I have the following code:
> ---------------------------------------
> from mod_python import apache
> from folder import Messenger
>
> def handler(req):
>
> msg = Messenger(req):
>
> # using req.write
>
> msg.write("hello world")
>
> return apache.OK
> -----------------------------------------
> So the Messenger class has the method "write" which calls req.write.
> This will output "hello world" in the browser. However, when I go into
> Messenger and change the method name from "write" to anything else, it
> still works. It is as if the class is being cached. I have deleted pyc
> but that has not done anything either. What is going on?


This has come up on the mod_python list a number of times, please see
these threads, among others:

http://www.modpython.org/pipermail/mod_python/2004-October/016567.html
http://www.modpython.org/pipermail/mod_python/2004-February/014959.html
http://www.modpython.org/pipermail/mod_python/2005-April/017859.html
http://www.modpython.org/pipermail/mod_python/2005-July/018619.html

and especially these articles:

http://www.dscpl.com.au/wiki/ModPython/Articles/ModuleImportingIsBroken
http://www.dscpl.com.au/wiki/ModPython/Articles/BasicsOfModuleImporting

Actually the mod_python list is very responsive one to mod_python
questions probably much more than this (the python list). You can sign
up here:

http://mailman.modpython.org/mailman/listinfo/mod_python

HTH,
Daniel



More information about the Python-list mailing list