equal
deleted
inserted
replaced
425 return temp |
425 return temp |
426 raise IOError, (errno.EEXIST, "No usable temporary filename found") |
426 raise IOError, (errno.EEXIST, "No usable temporary filename found") |
427 |
427 |
428 temp = tempname(dst) |
428 temp = tempname(dst) |
429 os.rename(dst, temp) |
429 os.rename(dst, temp) |
430 os.unlink(temp) |
430 try: |
|
431 os.unlink(temp) |
|
432 except: |
|
433 # Some rude AV-scanners on Windows may cause the unlink to |
|
434 # fail. Not aborting here just leaks the temp file, whereas |
|
435 # aborting at this point may leave serious inconsistencies. |
|
436 # Ideally, we would notify the user here. |
|
437 pass |
431 os.rename(src, dst) |
438 os.rename(src, dst) |
432 |
439 |
433 def unlink(f): |
440 def unlink(f): |
434 """unlink and remove the directory if it is empty""" |
441 """unlink and remove the directory if it is empty""" |
435 os.unlink(f) |
442 os.unlink(f) |