[mod_python] Re: import requires apache restart?

apocalypznow apocalypznow at gmail.com
Fri Oct 19 01:04:54 EDT 2007

But does apache.import_module() handle .pyc or .pyo files?

Graham Dumpleton wrote:
> This is quite normal behaviour. Standard Python modules and packages
> are not candidates for reloading. Read the documentation for
> import_module() in:
>   http://www.modpython.org/live/current/doc-html/pyapi-apmeth.html
> This explains the line of separation between when mod_python can and
> can not automatically reload modules.
> Graham
> On 19/10/2007, apocalypznow <apocalypznow at gmail.com> wrote:
>>I've noticed something, and I wonder if someone could please confirm if
>>this is the correct behaviour.  In my httpd.conf file, I've included the
>>path to a location where my python files are using the PythonPath
>>directive.  In my handler code file, I issue a standard "import"
>>statement rather than the mod_python (or for that matter,
>>vampire.importModule) versions of the import.  To give light protection
>>  (against authoring infringement) to my source files, after I
>>py_compile them, I delete the original .py files.
>>Even after changing the source of the files in the PythonPath, and after
>>py_compiling them, and after removing the original .py files, I found
>>that an Apache restart is required for the changes to be effected.  Does
>>this make sense?  If that is the case, is there some copy of the python
>>file being made by mod_python somewhere?
>>Mod_python mailing list
>>Mod_python at modpython.org

More information about the Mod_python mailing list