[Python-Dev] disable writing .py[co]
Matthias Klose
doko@cs.tu-berlin.de
Wed, 22 Jan 2003 01:21:53 +0100
Barry A. Warsaw writes:
>=20
> >>>>> "MvL" =3D=3D Martin v L=F6wis <martin@v.loewis.de> writes:
>=20
> MvL> No need is real. The specific requirement comes from
>=20
> MvL> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D96111
>=20
> MvL> where a user complains that mailman writes into /usr (writin=
g
> MvL> actually failed, but a Secure Linux kernel detected the
> MvL> problem, and the user wants to silence the warning,
> MvL> implementing some policy).
>=20
> MvL> It turns out that this is Python trying to write .pyc
> MvL> files. It would be desirable to turn pyc generation
> MvL> completely off for mailman. This could be done best through
> MvL> actually modifying the mailman source code. Setting an
> MvL> environment variable is less convenient, as you then have to=
> MvL> find all places where mailman scripts are invoked, or have t=
o
> MvL> wrap all mailman scripts.
>=20
> That particular bug is because the debian package isn't/wasn't
> complete. In a from-source installation of Mailman, we do indeed run=
> compileall.py on all the Python files. From skimming the debian bug
> report, it looks like they fixed their post-install script to do the
> same.
yes, but one file mm_cfg.py is a configuration file, which should not
be compiled. This is not specific to mailman. A core configuration
file is site.py, which shouldn't be compiled as well, so here it would
make sense to use a sys.<dontcompileflag>.