Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-116

Attributes removed from module code file still accessible until restart.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.4, 3.2.7
    • 3.3.1
    • core
    • None

    Description

      When using "apache.import_module()" directly, or when it is used indirectly by the "Python*Handler" directives, and automatic module reloading occurs, modules are reloaded on top of the existing module. One of the problems with this is that if an attribute such as a function or data value is removed from the code file on disk, when the module is reloaded, that attribute doesn't get removed from the in memory module held by mod_python. The only way to eliminate such an attributed from the in memory module currently is to restart Apache, automatic module reloading doesn't help.

      A good example of the problems this can cause is with mod_python.publisher. Because attributes can be arbitrarily mapped to by a URL, if you forget to prefix variables or functions with an underscore they will be visible to a request. If such a mistake was realised and you change the source code to add an underscore prefix and relied on automatic module reloading, it wouldn't actually get rid of the incorrectly named attribute in the module held in the mod_python cache. Thus, the restart of Apache is still required.

      As it stands for mod_python.publisher, the problem is fixed in 3.2.6, but it still exists for direct use of "apache.import_module()" and "Python*Handler" directives. The consequences outside of mod_python.publisher may not be as problematic, bu depends on specific user code.

      A scheme whereby new modules are reloaded into a new module instance would eliminate this problem.

      Attachments

        Issue Links

          Activity

            People

              grahamd Graham Phillip Dumpleton
              grahamd Graham Phillip Dumpleton
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: