cubicweb/web/views/staticcontrollers.py
changeset 12223 79d243a2f0c5
parent 11913 4516c3956d46
child 12310 aa999699e504
equal deleted inserted replaced
12222:52f395015ff9 12223:79d243a2f0c5
   166                             with open(osp.join(dirpath, rid), 'rb') as source:
   166                             with open(osp.join(dirpath, rid), 'rb') as source:
   167                                 for line in source:
   167                                 for line in source:
   168                                     f.write(line)
   168                                     f.write(line)
   169                             f.write(b'\n')
   169                             f.write(b'\n')
   170                     f.close()
   170                     f.close()
   171                 except:
   171                 except Exception:
   172                     os.remove(tmpfile)
   172                     os.remove(tmpfile)
   173                     raise
   173                     raise
   174                 else:
   174                 else:
   175                     os.rename(tmpfile, filepath)
   175                     os.rename(tmpfile, filepath)
   176         return filepath
   176         return filepath