[Python-Dev] Windows installer and .pyc files mtime

Thomas Heller theller at python.net
Thu Aug 28 11:09:24 EDT 2003

"Tim Peters" <tim.one at comcast.net> writes:

> [Guido]
>> If this isn't done, a problem might be (and this is why this is always
>> done on Unix) that if the user who installs Python has more privileges
>> than the user who uses Python, the user who uses Python may not be
>> able to write the directory containing .pyc files, so they end up
>> recompiling all modules each time they are loaded.
>> I expect this will be more of a problem as typical Windows users and
>> installations (e.g. XP) become more security aware, software is
>> installed by Administrator, and users don't have Administrator
>> privileges.
>> I guess the way to implement it (and I believe Mark Hammond did indeed
>> do this for win32all) is to run Python near the end of the installer
>> with the compileall.py script as an argument.
>> Feeling-quite-the-Windows-XP-expert-lately,
> Cool.  If an organization has enough money to afford an administrator who
> installs stuff for unprivileged masses, they have enough money to pay Thomas
> to make this change <0.5 wink>.

While I'm still waiting for the money to come in, I have changed the
wise script (but this is still uncommitted) to fire up compileall.py
on the standard library, exluding the Lib/test subdir, in both normal
and optimized mode.  This can be disabled in the advanced install
options dialog.
It fires up this ugly dos box, but I don't have time nor motivation to
write a wise extension only for a progress bar instead - the only other
possibility would be to run the compilation with pythonw.exe, and so
totally hide it from the user, and run it in the background without
waiting for it.

If I find time before my vacation, I can try to build an installer beta
and upload it to starship (hopefully this works again), if anyone wants
to try it out.

> Mark once told me he compiles stuff at the end of the win32all install
> because generating Windows type libraries can take a long time, and users
> griped about feeling the pain of that on first use otherwise.
> That's a reason I can understand <wink>.  If you can too, then it's more
> important to precompile everything needed for IDLE to start up the first
> time.


More information about the Python-Dev mailing list