[Python-Dev] .pyc location?

Brett Cannon brett at python.org
Fri Nov 23 19:28:22 CET 2007


On Nov 23, 2007 10:02 AM, Andreas Raab <andreas.raab at gmx.de> wrote:
> Nick Coghlan wrote:
> > Issues with collocating the compiled files with the source files do
> > arise occasionally, but they can generally be resolved by having root
> > run compileall [1] over the affected directories. In cases where users
> > are able to modify source files (hence leading to the need to recompile
> > them after installation), those users are also typically able to write
> > the necessary .pyc files to the same directory.
>
> Thanks, I'll try using compileall before digging deeper. If the file
> times are preserved correctly by the various installers this should do
> the trick.

There is also importlib which is import implemented in Python
(currently in Python's sandbox in svn).  Skipping .pyc compilation is
not hard in what instance as you just subclass something and overload
a single method.

-Brett


More information about the Python-Dev mailing list