def really_rename(source,target):
    if sys.platform != "win32":
        os.rename(source,target)
    else:
        for _ in xrange(100):
            try:
                os.rename(source,target)
            except WindowsError, e:
                if e.errno not in (errno.EACCES,):
                    raise
                time.sleep(0.01)
            else:
                break
        else:
            os.rename(source,target)
Like os.rename, but try to work around some win32 wierdness.
dataset/ETHPy150Open cloudmatrix/esky/esky/util.py/really_rename