[mod_python] Strange Namespace issue

Rune Strand Rune.Strand at student.uib.no
Fri Sep 3 06:14:54 EDT 2004

I was making a small math quiz thing, when I came across some strange
behaviour in either me or Mod_Python.

1. If FORM in file test.html POST to ACTION 'test.py/someFunc', nothing
happens. If I rename test.py to t.py, it does. Is that by design?

2. I was experimenting with passing values from page to page, when I
discovered that I could do this without cookies, hidden values or URL
extensions like '?A=x&B=y' I could just call the function directly in the
POST statement. So I grokked a little with a script that basically - takes
input from user, - posts it to a function that stores the input in a
global variable (list) - calls a function that generates html for a new
page, now with a a form that'll post to another function. (See below if
you're interested in the files.)

And the global variable happily appends all the userinput from page to

Then, shortly after completing the test, I can access the starting page
from another host in my network. What happens is that the list continues
to expand, it still holds the values posted from the first host. They
share memory!

Now, I suppose this makes sense with regards to modules, for
instance, but should a variable in a script be super global?

When accessing the files from a second or third host, the Apache error
log, appends: "[notice] mod_python: (Re)importing module 't' with path set
to '[path_to_files]'".

Is it something strange here, or should I be more careful with my
namespace ;-)


--------- The files to repro:
<http://www.uib.no/People/stud2080/mp_namespace.zip> [2Kb]
SPECS = [Win 2003 Server, Apache 2.0.49, Python 2.3.3, Mod_Python 3.1.3]

More information about the Mod_python mailing list