[Distutils] Replacing pip.exe with a Python script

Steve Dower Steve.Dower at microsoft.com
Wed Jul 17 20:55:39 CEST 2013


> I'm afraid exe files as wrappers are probably the only viable option. The basic
> reason is that the OS recognises exe files in all context, with no special
> configuration needed. This is not true of any other file type. So anything else
> will have corner cases that will give unexpected results.

No reason to be afraid of this, exe wrappers are totally the best option.

As for updating .exes while they're running, the best approach is to rename the running one (e.g. 'pip.exe' -> 'pip.exe.deleteme') in the same folder and either:
* delete any existing .deleteme files on next run, or
* delete an existing pip.exe.deleteme file immediately before trying to rename to it

Any other approach will also have corner cases, but this will be the most reliable in the context of multiple users/permissions/environment variables.

> Paul

Steve



More information about the Distutils-SIG mailing list