You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/03/05 05:38:39 UTC
[jira] Closed: (MODPYTHON-11) Cross contamination of modules
[ http://issues.apache.org/jira/browse/MODPYTHON-11?page=all ]
Graham Dumpleton closed MODPYTHON-11:
-------------------------------------
> Cross contamination of modules
> ------------------------------
>
> Key: MODPYTHON-11
> URL: http://issues.apache.org/jira/browse/MODPYTHON-11
> Project: mod_python
> Type: Bug
> Versions: 3.1.3
> Reporter: Graham Dumpleton
> Assignee: Nicolas Lehuen
> Priority: Minor
> Fix For: 3.2.7
>
> This carries on from MODPYTHON-10. In fixing MODPYTHON-10, this problem
> is likely to be addressed. Text taken from mailing list.
> Cross contamination of modules
> ------------------------------
> For the above case, change the code in "subdir-1/index.py" to:
> subdir1 = None
> def index():
> return "subdir-1",globals().keys()
> and "subdir-2/index.py" to:
> subdir2 = None
> def index():
> return "subdir-2",globals().keys()
> Accessing "subdir-1" the result is:
> ('subdir-1', ['index', '__mtime__', '__builtins__',
> '__file__', 'subdir1', '__name__', '__doc__'])
> Now accessing "subdir-2" the result is:
> ('subdir-2', ['index', '__mtime__', '__builtins__',
> '__file__', 'subdir2', 'subdir1', '__name__', '__doc__'])
> Back to "subdir-1" again:
> ('subdir-1', ['index', '__mtime__', '__builtins__',
> '__file__', 'subdir2', 'subdir1', '__name__', '__doc__'])
> Because modules of the same name are reimported on top of the existing
> module you can end up with cross contamination of modules in respect of
> global variables, functions, class definitions, module imports etc.
> The most obvious problem this causes with publisher, is that one can
> suddenly have appear in a module a function from a different module. This
> function then becomes accessible using an appropriate URL via the module
> in which it doesn't belong.
> Overall this is annoying and could be problematic for those unaware.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira