[mod_python] mod_python.publisher pyc

Graham Dumpleton graham.dumpleton at gmail.com
Thu Jun 12 22:04:40 EDT 2008


2008/6/13 Gustavo Henrique Cervi <gustavo-listas at overstep.com.br>:
> Hi, is there a way to execute .pyc files instead .py? or something like this
> to have a little protection against user modifications.

The mod_python.publisher extension uses mod_python module importer and
in mod_python 3.3.1 that means that .pyc files are neither generated
nor used for the publisher code files.

In general, using .pyc files as a means of protecting your code from
prying eyes is flawed as there are decompilers readily available for

If you still insist on using such a scheme, make the publisher code
files in document tree very thin wrappers which import normal Python
modules from a directory outside of document tree, where that other
directory containing the modules is listed in PythonPath. By doing
that, standard Python module importer used and .pyc files works as


More information about the Mod_python mailing list