By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

Mod Python Question

P: n/a
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.

May 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/m...er/016567.html
http://www.modpython.org/pipermail/m...ry/014959.html
http://www.modpython.org/pipermail/m...il/017859.html
http://www.modpython.org/pipermail/m...ly/018619.html

and especially these articles:

http://www.dscpl.com.au/wiki/ModPyth...ortingIsBroken
http://www.dscpl.com.au/wiki/ModPyth...oduleImporting

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...nfo/mod_python

HTH,
Daniel
May 8 '07 #2

P: n/a
On May 8, 6:07 pm, "Daniel Nogradi" <nogr...@gmail.comwrote:
I am very new toPythonand 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/m...ly/018619.html

and especially these articles:

http://www.dscpl.com.au/wiki/ModPyth...oduleImporting

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...nfo/mod_python

HTH,
Daniel
Thanks Daniel. That what I needed.

May 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.