Mod Python Question

D

descartes

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?

Thanks.
 
D

Daniel Nogradi

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
 
D

descartes

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

http://www.modpython.org/pipermail/...rg/pipermail/mod_python/2005-July/018619.html

and especially these articles:

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

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

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

HTH,
Daniel

Thanks Daniel. That what I needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top