Issue Details (XML | Word | Printable)

Key: MODPYTHON-147
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

PythonImport directives causing duplicate entries in sys.path.

Created: 17/Mar/06 02:02 PM   Updated: 11/Apr/07 11:35 AM
Return to search
Component/s: None
Affects Version/s: 3.1.4, 3.2.8
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Issue Links:
Reference
 

Resolution Date: 17/Mar/06 05:30 PM


 Description  « Hide
When PythonPath is used at global scope within the Apache configuration and more than one PythonImport directive is used against the same interpreter, duplicated entries can be added to sys.path.

This is because src/mod_python.c is evaluating PythonPath every time that a PythonImport directive is acted upon even if a PythonImport directive for the same interpreter has already been processed.

In other words, if you have:

PythonPath "['/some/path']+sys.path"
PythonImport module1 testing
PythonImport module2 testing
PythonImport module3 testing

then '/some/path' will be added to sys.path within context of interpreter called 'testing' a total of three times.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #386591 Fri Mar 17 09:26:56 UTC 2006 grahamd Fixed race conditions on setting sys.path when the PythonPath directive is
being used as well as problems with infinite extension of path. (MODPYTHON-114)
Stopped directories being added to sys.path multiple times when PythonImport
and PythonPath directive used. (MODPYTHON-147)
Files Changed
MODIFY /httpd/mod_python/trunk/test/htdocs/tests.py
MODIFY /httpd/mod_python/trunk/src/mod_python.c
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py