def renamer(old, new, fsync=True):
 dirpath = os.path.dirname(new)
 try:
  count = makedirs_count(dirpath)
  os.rename(old, new)
 except OSError:
  count = makedirs_count(dirpath)
  os.rename(old, new)
 if fsync:
  for i in range(0, (count + 1)):
   fsync_dir(dirpath)
   dirpath = os.path.dirname(dirpath)

def renamer ( old , new , fsync = True ) : dirpath = os . path . dirname ( new ) try : count = makedirs_count ( dirpath ) os . rename ( old , new ) except OSError : count = makedirs_count ( dirpath ) os . rename ( old , new ) if fsync : for i in range ( 0 , ( count + 1 ) ) : fsync_dir ( dirpath ) dirpath = os . path . dirname ( dirpath )
attempt to fix / hide race conditions like empty object directories being removed by backend processes during uploads .