mod_python
  1. mod_python
  2. MODPYTHON-147

PythonImport directives causing duplicate entries in sys.path.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.4, 3.2.8
    • Fix Version/s: 3.3.1
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Issue Links

          Activity

          Hide
          Graham Dumpleton added a comment -

          MODPYTHON-114 and MODPYTHON-147 need to be fixed at the same time.

          Show
          Graham Dumpleton added a comment - MODPYTHON-114 and MODPYTHON-147 need to be fixed at the same time.

            People

            • Assignee:
              Graham Dumpleton
              Reporter:
              Graham Dumpleton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development