Issue Details (XML | Word | Printable)

Key: MODPYTHON-154
Type: Sub-task Sub-task
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
MODPYTHON-143

PythonPath overriding use of Python*Handler directory.

Created: 09/Apr/06 02:37 PM   Updated: 11/Apr/07 11:40 AM
Return to search
Component/s: importer
Affects Version/s: None
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Resolution Date: 25/Apr/06 01:03 PM


 Description  « Hide
The behaviour of the old importer is such that if the PythonPath directive has been used in the same or parent configuration context, then any physical directory corresponding to where the Python*Handler directive was used, is not added to sys.path.

The new importer currently preserves the above behaviour, but since the new importer does not actually add the directory associated with the Python*Handler directive into sys.path, it doesn't seem to make any sense that setting PythonPath should cause the directory the Python*Handler directive is associated with to be ignored.

Thus propose that PythonPath should be kept quite distinct from directories in document tree for which Python*Handler is specified for and setting PythonPath will would no longer cause directory Python*Handler directive is specified for to be ignored.

Overall, this should actually eliminate unexpected behaviour whereby user sets PythonPath and then finds their modules in document tree can't be found. The only solution to this with the old importer is to add the directories in the document tree explicitly to PythonPath directive.

If there is some valid reason that the new importer should never look in the document tree for modules, then it would be better handled by some sort of PythonOption rather than it be a side effect of having used the PythonPath directive.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #396775 Tue Apr 25 06:02:54 UTC 2006 grahamd Don't have new importer look by default in handler root directory unless
file the import is being done from is in that directory. Looking in the
handler root directory can be enabled if needed for backward compatibility.
When enabled, PythonPath being set does not prevent the lookup occuring.
(MODPYTHON-154)
Files Changed
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/importer.py
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h