Apache Mod-Python - Commented: (MODPYTHON-154) PythonPath overriding use of

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > April 2006 > Commented: (MODPYTHON-154) PythonPath overriding use of





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Commented: (MODPYTHON-154) PythonPath overriding use of
Graham Dumpleton (JIRA)

2006-04-27, 6:52 am

[ http://issues.apache.org/jira/brows...action_12376138 ]

Graham Dumpleton commented on MODPYTHON-154:
--------------------------------------------

What I have decided to do here is by default not allow the new importer to look back in the handler root directory where import is done from another directory. This is in the interests of making rules simpler and more predictable. In case for some reason
code is dependent on this behaviour, will provide a PythonOption "mod_python.importer.mimic_old_rules" which can be set to enable the old type of lookup rules. The purpose of this would only be to allow such code to run until it can be modified to work wi
th the new module lookup rules.


> PythonPath overriding use of Python*Handler directory.
> ------------------------------------------------------
>
> Key: MODPYTHON-154
> URL: http://issues.apache.org/jira/browse/MODPYTHON-154
> Project: mod_python
> Type: Sub-task


> Components: importer
> Reporter: Graham Dumpleton
> Assignee: Graham Dumpleton


>
> 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 t

he 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 explic

itly 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.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com