[Python-Dev] Proto-PEP regarding writing bytecode files

Skip Montanaro skip@pobox.com
Thu, 23 Jan 2003 11:44:48 -0600


    Tim> I think this is wrong behaviour. IMO it should be as follows:

    ...

Fixed.  View the damage in pep0304.

    >> - When looking for a bytecode file should the directory holding the
    >>   source file be considered as well, or just the location implied by
    >>   PYCROOT?  If so, which should be searched first?  It seems to me
    >>   that if a module lives in /usr/local/lib/python2.3/mod.py and was
    >>   installed by root without PYCROOT set, you'd want to use the
    >>   bytecode file there if it was up-to-date without ever considering
    >>   os.environ["PYCROOT"] + "/usr/local/lib/python2.3/".  Only if you
    >>   need to write out a bytecode file would anything turn up there.

    Tim> I think it should always use PYCROOT.

I have it first looking in the directory in sys.path, then in the augmented
directory (roughly PYTHONBYTECODEBASE+sys.path[n]).  Can you offer reasons
to only consider the augmented directory?

Skip