~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Aaron Bentley
  • Date: 2007-04-16 15:38:10 UTC
  • mto: (1551.19.24 Aaron's mergeable stuff)
  • mto: This revision was merged to the branch mainline in revision 2423.
  • Revision ID: abentley@panoramicfeedback.com-20070416153810-llz9qggakjio05ku
FTP does not require atomic rename. Fixes #89436

Show diffs side-by-side

added added

removed removed

Lines of Context:
224
224
            # If the file used to exist, rename it back into place
225
225
            # otherwise just delete it from the tmp location
226
226
            if success:
227
 
                unlink_func(tmp_name)
 
227
                try:
 
228
                    unlink_func(tmp_name)
 
229
                except:
 
230
                    # If the unlink fails, then restore the old state, as if
 
231
                    # an atomic rename failed
 
232
                    rename_func(new, old)
 
233
                    rename_func(tmp_name, new)
 
234
                    raise
228
235
            else:
229
236
                rename_func(tmp_name, new)
230
237