[Python-Dev] disable writing .py[co]

Guido van Rossum guido@python.org
Tue, 21 Jan 2003 09:48:57 -0500


> Skip Montanaro <skip@pobox.com> writes:
> 
> > Here's a slightly different alternative.  (It woke me up this morning, so I
> > know it's a good idea. ;-)
> > 
> > Instead of an environment variable which functions simply as an on/off
> > switch, add an environment variable named PYCROOT which can be used to
> > control writing of .pyc files as follows:
> > 
> >     * if not present, status quo
> > 
> >     * if present and refers to an existing directory, prepend PYCROOT to any
> >       attempts to read or write .pyc files.
> 
> The idea of writing .pycs to a world writable area (say /tmp) on a
> multi-user system sounds like a Bad Thing.

Years ago, Bill Janssen at Xerox had a use case for this: they
apparently have a setup where the normal way of accessing files is a
shared replicated read-only virtual filesystem, but you can prefix
something to a path that accesses a writable server (if you have
permissions of course).

--Guido van Rossum (home page: http://www.python.org/~guido/)