> > This brings up another interesting point: are the .pyc files guarded agains
> > concurrent generation?
> Yes. The timestamp and magic number are written last, in one write
As stated, this is not enough. It can happen that two processes start
writing the same .pyc file at the same time. I suppose that usually
the two processes will write identical copies, but when there are
different versions of python around, that may not be the case.
A better approach would be to write to a temporary file first and
linking the temporary file to the .pyc file at the end. When linking
fails, someone else was there before you, so you can ignore the error.
Sjoerd Mullender, CWI, P.O. Box 94079, 1090 GB Amsterdam, The Netherlands
E-Mail: Sjoerd.Mullender@cwi.nl; Phone: +31 20 592 4127; Fax: +31 20 592 4199