
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
28/Apr/05 12:54 AM
|
|
Using mod_python.publisher, you have two modules :
/index.py
/subdir/index.py
The problem is that due to the way published modules are imported, the resulting behaviour is unpredictable. Sometimes when calling /subdir/index.py the /index.py module is called, and vice versa.
This bug is very annoying because new mod_python users encounter it frequently, and I don't think it gives good press to mod_python.
|
|
Description
|
Using mod_python.publisher, you have two modules :
/index.py
/subdir/index.py
The problem is that due to the way published modules are imported, the resulting behaviour is unpredictable. Sometimes when calling /subdir/index.py the /index.py module is called, and vice versa.
This bug is very annoying because new mod_python users encounter it frequently, and I don't think it gives good press to mod_python. |
Show » |
|
Sticky modules obscuring real module
------------------------------------
Create and "index.py", "subdir-1/index.py" and "subdir-2/index.py" all
containing:
import os
def index():
return os.getpid(),__file__
Now cycle through accessing these in the order:
index.py
subdir-1/index.py
index.py
subdir-2/index.py
index.py
subdir-1/index.py
index.py
subdir-2/index.py
...
In my case this is:
/~grahamd/publisher
/~grahamd/publisher/subdir-1
/~grahamd/publisher
/~grahamd/publisher/subdir-2
/~grahamd/publisher
/~grahamd/publisher/subdir-1
/~grahamd/publisher
/~grahamd/publisher/subdir-2
/~grahamd/publisher
...
The result for this is:
(521, '/Users/grahamd/Sites/publisher/index.py')
(521, '/Users/grahamd/Sites/publisher/subdir-1/index.py')
(521, '/Users/grahamd/Sites/publisher/subdir-1/index.py')
(521, '/Users/grahamd/Sites/publisher/subdir-2/index.py')
(521, '/Users/grahamd/Sites/publisher/subdir-2/index.py')
(521, '/Users/grahamd/Sites/publisher/subdir-1/index.pyc')
(521, '/Users/grahamd/Sites/publisher/subdir-1/index.pyc')
(521, '/Users/grahamd/Sites/publisher/subdir-2/index.pyc')
(521, '/Users/grahamd/Sites/publisher/subdir-2/index.pyc')
One can see that once one of the "index.py" files in the subdirectories is
accessed, they become sticky and the latest one accessed from a subdirectory
is returned instead of the top level one when it is accessed.
This one has got to be a bug.