python-pillow/Pillow — pull request #844 by divergentdave (2014-08-11 06:14:54+00:00)
Title: setup.py: Close open file handle before deleting

When installing Pillow onto a Vagrant virtual machine with Linux as the guest OS, and Windows as the host OS, setup.py fails with the error "Text file busy." The temporary installation directory is a shared folder from the host OS, mounted in the guest OS, and the underlying Windows file system doesn't allow deleting the "multiarch" temporary file while a file handle for it is still open. This change closes the file handle once it is no longer being used, but before the file itself is unlinked.