Close the file before trying to remove the directory so it works on Windows.
As reported by Trent Nelson on python-dev.
1 file changed