473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Mod Python Question

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
2 1125
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Carl | last post by:
"Nine Language Performance Round-up: Benchmarking Math & File I/O" http://www.osnews.com/story.php?news_id=5602 I think this is an unfair comparison! I wouldn't dream of developing a numerical...
114
by: Maurice LING | last post by:
This may be a dumb thing to ask, but besides the penalty for dynamic typing, is there any other real reasons that Python is slower than Java? maurice
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
158
by: Giovanni Bajo | last post by:
Hello, I just read this mail by Brett Cannon: http://mail.python.org/pipermail/python-dev/2006-October/069139.html where the "PSF infrastracture committee", after weeks of evaluation, recommends...
4
by: Martitza | last post by:
Hi. I work for a small company (actually in process of forming) interested in embedding or extending python as part of our commercial non-open-source product. We have legal counsel, but are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.