equal
deleted
inserted
replaced
685 d, fn = os.path.split(name) |
685 d, fn = os.path.split(name) |
686 fd, temp = tempfile.mkstemp(prefix='.%s-' % fn, dir=d) |
686 fd, temp = tempfile.mkstemp(prefix='.%s-' % fn, dir=d) |
687 os.close(fd) |
687 os.close(fd) |
688 fp = posixfile(temp, "wb") |
688 fp = posixfile(temp, "wb") |
689 try: |
689 try: |
690 fp.write(posixfile(name, "rb").read()) |
690 try: |
|
691 s = posixfile(name, "rb").read() |
|
692 except IOError, inst: |
|
693 if not getattr(inst, 'filename', None): |
|
694 inst.filename = name |
|
695 raise |
|
696 fp.write(s) |
691 except: |
697 except: |
692 try: os.unlink(temp) |
698 try: os.unlink(temp) |
693 except: pass |
699 except: pass |
694 raise |
700 raise |
695 fp.close() |
701 fp.close() |