If os.replace() is available, you may want to use that instead (see http://docs.python.org/3/library/os#os.replace).