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/05/01 13:51:46 UTC

[jira] Resolved: (MODPYTHON-156) Module imports from server side includes and new importer.

     [ http://issues.apache.org/jira/browse/MODPYTHON-156?page=all ]
     
Graham Dumpleton resolved MODPYTHON-156:
----------------------------------------

    Fix Version: 3.3
     Resolution: Fixed

> Module imports from server side includes and new importer.
> ----------------------------------------------------------
>
>          Key: MODPYTHON-156
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-156
>      Project: mod_python
>         Type: Sub-task

>   Components: importer
>     Reporter: Graham Dumpleton
>     Assignee: Graham Dumpleton
>      Fix For: 3.3

>
> With old module importer, where Python*Handler directives are used in a directory context, that directory is added to sys.path. Now where Python code is being used with server side includes in that same directory and code of form:
>   module = apache.import_module("xxx")
> is used with "xxx.py" also being in the same directory, it will be found due to the directory being added to sys.path.
> With the new module importer, the directory isn't added to sys.path and so the module would not be found.
> In the case of a handler module (rather than SSI Python code), such a module import would still work, as the new module importer is smart enough to realise that the caller was also imported using the new module importer and thus would look in the same directory first or as necessary, in the directory the Python*Handler directive was specified for. This will not work for SSI code though, as it is not part of an imported module and is eval/exec'd on each page request.
> What is thus required is for the global environment in which the SSI code is executed for a specific page, to be automatically marked up in such a way that the new module importer believes it was imported as a module by the new module importer, thus triggering it to look in the same directory for modules.

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